Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you talking Autotest ala <a href="http://ph7spot.com/musings/getting-started-with-autotest" rel="nofollow">Ruby Autotest</a>? If so, maybe <a href="http://www.rubyinside.com/watchr-generic-autotest-alternativ-2511.html" rel="nofollow">Watchr</a> would work for you. Yes, you would need to install the Ruby runtime on your development machine, but it looks like it can trigger pretty much anything that can be done on the command line when the file system changes. For example, if you wanted Watchr to build and run your C++ tests anytime a .c/.cpp/.h/.hpp file in your source tree changed you could do something like this:</p> <pre><code>watch('src/(.*)\.[h|cpp|hpp|c]') {system "build/buildAndRunTests.bat"} </code></pre> <p>This particular command obviously makes some assumptions about how your build process is set up (and obviously that you're on Windows), but that should be the gist of it. Our team configures our unit test projects with a post-build event that automatically runs the built unit test binary, so we can just trigger that part of our build process within the <code>buildAndRunTests.bat</code> script and have it print the results to the command-line. It might take some tweaking but it looks like Watchr may be a good choice. I'll update this response when I give it a shot (hopefully early next week).</p> <p><strong>UPDATE</strong>: I just tried this with one of my C# projects and got it working there. So I theoretically it should work with C++ projects as well.</p> <p><em>autotest.watchr</em>:</p> <pre><code>watch('./.*/.*\.cs$') {system "cd build &amp;&amp; buildAndRunTests.bat &amp;&amp; cd ..\\"} </code></pre> <p>Note the <strong>$</strong> at the end of the regular expression. This is important because there are a lot of artifacts generated in the source tree at build time and if any of them match the string <em>.cs</em> it will trigger another run, effectively causing an infinite loop. Conceivably the same thing will happen if you generate/modify any source files at build time so you may have to find a way to compensate.</p> <p><em>buildAndRunTests.bat</em>:</p> <pre><code>pushd ..\ rem Build test project "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com" Tests.Unit\Tests.Unit.csproj /rebuild Release popd rem Navigate to the directory containing the built files pushd ..\Tests.Unit\bin\Release rem Run the tests through nunit-console ..\..\..\Dependencies\NUnit-2.5.5-bin\net-2.0\nunit-console.exe Tests.Unit.dll /run=Tests.Unit popd </code></pre> <p>Then, in a seperate console window just navigate to your project directory and run the following command (assumes <em>autotest.watchr</em> is at the top of your project tree, see below):</p> <pre><code>watchr autotest.watchr </code></pre> <p>Now, when any .cs files change in the source tree it will run the <em>buildAndRunTests.bat</em> script automatically. This is just an example from my local machine so it likely won't work verbatim on yours, but you should be able to tweak it to your needs.</p> <p>This is the directory structure for reference:</p> <pre><code>/Project /build buildAndRunTests.bat /Tests.Unit /Dependencies /NUnit-2.5.5-bin /net-2.0 nunit-console.exe autotest.watchr </code></pre> <p>I hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload