[phobos] Silent failure of std.container unittests
Walter Bright
walter at digitalmars.com
Thu Jul 15 16:11:28 PDT 2010
Sean Kelly wrote:
> On Jul 15, 2010, at 3:00 PM, Walter Bright wrote:
>
>>> NOT YET:
>>>
>>> 4. DESIRED: assert is NOT hacked, any failing assert ends the current unittest, the failure message is printed, execution continues with the next unittest, program ends with error code if at least one assert failed, everybody's happy.
>>>
>>>
>> Everybody's happy except the guys like me who want to run all the unit tests in one go.
>>
>
> All the unit tests or all the asserts?
All the asserts.
> All the unit tests are run with this approach:
>
> module A;
>
> unittest {
> assert(false, "test 1a failed");
> assert(false, "test 1b failed");
> }
>
> unittest {
> assert(false, "test 2 failed");
> }
>
> This should print:
>
> test 1a failed
> test 2 failed
>
> I'm not sure I understand the problem of breaking unit tests into a collection of atomic blocks.
Extra work.
> With version(unittest) globals can even be used if state should be retained across tests.
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>
>
More information about the phobos
mailing list