About unittest, test runners and assert libraries

Zardoz luis.panadero at gmail.com
Wed May 12 18:52:13 UTC 2021


On Monday, 10 May 2021 at 17:45:03 UTC, Andre Pany wrote:
> On Monday, 10 May 2021 at 17:20:54 UTC, Zardoz wrote:
>> I like to talk about the state of unit testing, test runner & 
>> frameworks and assert libraries, as I did some little 
>> experiments recently.
>>
>> [...]
>
> Just some comments regarding D-Unit:
>
> You can run it just using `dub test` by using a dub 
> configuration `unittest`.
>
> If I am not completely wrong it does not ignore `unittest` 
> blocks. It shows the result of the unittest blocks in the 
> output.
>
> You use asserts in your productive logic for program errors, 
> therefore it make sense that D-Unit Mark's them as errors. (For 
> resource errors on the other hand you use Exceptions).
>
> Kind regards
> Andre

It just ignores the unit test blocks, You can try here : 
https://github.com/Zardoz89/pijamas/tree/develop

Launch with dub run --root=tests/d-unit
Also, you can launch with dub run --root=tests/d-unit -c 
fail-tests to enable enforce some failing/errors on the test 
cases.

Also, I try again with dub test . It just executes the dlang 
default unit test runner. Perhaps I have something wrong on 
dub.json



More information about the Digitalmars-d mailing list