unit-threaded v0.5.7 - advanced multi-threaded unit testing library

Sebastiaan Koppe via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Feb 17 00:59:11 PST 2016


On Wednesday, 17 February 2016 at 07:46:51 UTC, Jacob Carlborg 
wrote:
> On 2016-02-16 23:13, Sebastiaan Koppe wrote:
>
>> Then to get `dub test` to run unit_threaded I had to create a 
>> small
>> program that discovers all modules and generates a 
>> testrunner.d file in
>> the source directory, which gets picked up by dub. So now 
>> instead of
>> `dub test` I call `rdmd test.d`, which generates the 
>> testrunner.d and
>> calls dub test.
>>
>> I feel I am going against the grain here.
>
> "dub test" will generate a program that discovers all modules. 
> Not sure if it's compatible with unit-threaded.

It isn't, but I found a workaround. Dub has the preBuildCommands 
which allows you to run shell commands,. It now runs my small 
util that generates a testrunner compatible with unit-threaded. 
So now its just `dub test` again. Plus I can add modules as 
arguments so only those will be tested. (e.g. dub test -- 
my.module). This is a godsend.


More information about the Digitalmars-d-announce mailing list