Run your unit tests individually using Flute
Robert Fraser
fraserofthenight at gmail.com
Sat Dec 8 15:28:00 PST 2007
Okay, it's not actually done, but since I'm changing the interface to a
network-based/socket one that will be less viable for command-line
usage, I thought I'd announce the command-line version now.
Flute is a natural extension of UnittestWalker which allows you to run
unit tests one at a time, run only specific tests, track failures,
errors, and passes, etc., etc. It integrates directly with D's unittest
construct, so no additional coding on your part is necessary, just link
in the Flute module and enjoy! If you want to name your tests, you will
have to introduce a dependency on the naming module, however.
Docs:
http://www.dsource.org/projects/descent/browser/trunk/descent.unittest/flute/doc/flute.html?rev=938&format=raw
Source:
http://www.dsource.org/projects/descent/browser/trunk/descent.unittest/flute/src/org/dsource/descent/unittests/flute.d?rev=939&format=raw
Naming module:
http://www.dsource.org/projects/descent/browser/trunk/descent.unittest/flute/src/org/dsource/descent/unittests/naming.d?rev=938&format=raw
If all you want to do is run all your unit tests & track whether they
pass or fail, use UnittestWalker, which can already do that. Flute is
better if you plan to run your unit tests one by one.
Flute will hopefully soon be integrated with Descent which will give a
UI for you to track & run specific unit tests, change the source and
instantly re-run a particular test (hopefully with all the compilation,
etc. being transparent), etc.
However, since there's _not_ a UI right now, I'd suggest (once you get a
feel for it), piping input to stdin so you can create your own test
suites that run only particular tests, etc., since re-typing all those
test names won't be fun.
In its current form (which will likely be the final command-line form
unless someone wants to fork it), it doesn't support D2. I've actually
only tested it with DMD 1.020 on Windows. It should work on both Tango
and Phobos, but again I've only tested it on Phobos 1.020 and Tango
0.99.2, so I'm not 100% on that.
More information about the Digitalmars-d-announce
mailing list