"Try it now"

"Jérôme M. Berger" jeberger at free.fr
Fri Apr 15 23:31:57 PDT 2011


Roman Ivanov wrote:
> == Quote from Jacob Carlborg (doob at me.com)'s article
>> On 2011-04-14 18:48, Andrei Alexandrescu wrote:
>>> On 4/14/11 9:03 AM, Steven Schveighoffer wrote:
>>>> Sometimes, I worry that my unit tests or asserts aren't running. Every
>>>> once in a while, I have to change one to fail to make sure that code is
>>>> compiling (this is especially true when I'm doing version statements or
>>>> templates). It would be nice if there was a -assertprint mode which
>>>> showed asserts actually running (only for the module compiled with that
>>>> switch, of course).
>>> Could this be achieved within the language?
>>>
>>> Andrei
>> Don't know exactly how he wants it to behave but I have have a look one
>> of my earlier posts:
>>
> http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=134796
> 
> I'm somewhat shifting the topic, but it seems strange that unit tests are run when
> you run an executable. Wouldn't it make sense to run them immediately after
> compilation? I mean, what would be the use case where you would want to re-run a
> unit test on the code that's already compiled and tested? This could also solve
> the problem with messages on success, since you can output a success message after
> compilation.
> 
> Sorry if I'm missing some obvious issue with this suggestion.

	Off the top of my head, I see two reasons why running the tests
separately is a good thing:
 - It allows to run the test in a debugger;
 - Cross-compilation.

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr


More information about the Digitalmars-d mailing list