Thread overview
Unittest Walker
Dec 08, 2006
Thomas Kuehne
Dec 08, 2006
Lutger
Dec 08, 2006
Thomas Kuehne
Dec 08, 2006
Sean Kelly
December 08, 2006
If you are interested in executing all your unittests and don't want to stop after the first failed one you might be interested in the Unittest Walker.

sample output:
#
# testing some_module.__unittest1 ... SUCCESS
# testing some_module.__unittest2 ... FAILED: (Exception) just a sample
# testing some_module.__unittest3 ... SUCCESS
# Summary: 2/1/3 (succeeded/failed/total)
#

limitation:
works only on Linux

how to use:
1) download http://svn.dsource.org/projects/flectioned/downloads/flectioned.zip
2) gcc -c elf.c
3) dmd -unittest flectioned.d unittest_walker.d elf.o <your sources> -oftest
4) ./test

Thomas


December 08, 2006
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> If you are interested in executing all your unittests and don't
> want to stop after the first failed one you might be interested
> in the Unittest Walker.
> 
> sample output:
> #
> # testing some_module.__unittest1 ... SUCCESS
> # testing some_module.__unittest2 ... FAILED: (Exception) just a sample
> # testing some_module.__unittest3 ... SUCCESS
> # Summary: 2/1/3 (succeeded/failed/total)
> #
> 
> limitation:
> works only on Linux
> 
> how to use:
> 1) download http://svn.dsource.org/projects/flectioned/downloads/flectioned.zip
> 2) gcc -c elf.c
> 3) dmd -unittest flectioned.d unittest_walker.d elf.o <your sources> -oftest
> 4) ./test
> 
> Thomas

Good idea, I'll try it whenever I get around to install linux. What about something like this:

unittest("testing some stuff")
{ ... }

or perhaps this is better:

/// testing some stuff
unittest
{...}

testing some_module: "testing some stuff" ... SUCCESS


Is this possible / difficult?

December 08, 2006
Lutger schrieb am 2006-12-08:

<snip>

> Good idea, I'll try it whenever I get around to install linux. What about something like this:
>
> unittest("testing some stuff")
> { ... }
>
> or perhaps this is better:
>
> /// testing some stuff
> unittest
> {...}
>
> testing some_module: "testing some stuff" ... SUCCESS
>
>
> Is this possible / difficult?

This would require compiler support. You can however use someting like this:

#
# unittest {
# 	writefln("%s:%s %s", __FILE__, __LINE__, "your message here");
#	...
# }
#

Thomas


December 08, 2006
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Lutger schrieb am 2006-12-08:
> 
> <snip>
> 
>> Good idea, I'll try it whenever I get around to install linux. What about something like this:
>>
>> unittest("testing some stuff")
>> { ... }
>>
>> or perhaps this is better:
>>
>> /// testing some stuff
>> unittest
>> {...}
>>
>> testing some_module: "testing some stuff" ... SUCCESS
>>
>>
>> Is this possible / difficult?
> 
> This would require compiler support.

Could this be accomplished by modifying moduleinit.d in Phobos?  It already contains a debug printf to output the module being tested.


Sean