www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Run your unit tests individually using Flute

reply Robert Fraser <fraserofthenight gmail.com> writes:
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.
Dec 08 2007
parent reply "Kris" <foo bar.com> writes:
"Robert Fraser" <fraserofthenight gmail.com> wrote in
 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.

 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.

Very, very nice ...
Dec 08 2007
parent reply Robert Fraser <fraserofthenight gmail.com> writes:
Kris wrote:
 "Robert Fraser" <fraserofthenight gmail.com> wrote in
 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.


You don't have to name the tests; it's an option. If I choose to tie it to the Descent front-end, I'll remove the binary naming altogether.
 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.

Very, very nice ...

Okay, I can sense the sarcasm, but as I said this is a WIP, and I'm only releasing it because this is likely the last time it'll be useable without a frontend or telnet client.
Dec 08 2007
parent reply "Kris" <foo bar.com> writes:
"Robert Fraser" <fraserofthenight gmail.com> wrote
 Very, very nice ...


?? Woah there ... that was a sincere compliment, Robert. I truly think what you've done is awesome, just like the Descent work. Sorry if it came across any other way ...
Dec 08 2007
parent Robert Fraser <fraserofthenight gmail.com> writes:
Kris wrote:
 "Robert Fraser" <fraserofthenight gmail.com> wrote
 Very, very nice ...


?? Woah there ... that was a sincere compliment, Robert. I truly think what you've done is awesome, just like the Descent work. Sorry if it came across any other way ...

Oh, I'm sorry I misunderstood. Thanks for the complement. Tested it with Tango 0.99.1, 0.993 and Phobos in 1.024, works fine in all. Does NOT compile under D2 (likely under any version). I may add a version(CommandLine), so any updates can be usd in the CL version.
Dec 09 2007