[phobos] Silent failure of std.container unittests

Sean Kelly sean at invisibleduck.org
Thu Jul 15 15:20:55 PDT 2010


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 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.  With version(unittest) globals can even be used if state should be retained across tests.


More information about the phobos mailing list