How can one reliably run unittests

deadalnix deadalnix at gmail.com
Tue Aug 31 11:04:00 UTC 2021


On Saturday, 28 August 2021 at 00:47:44 UTC, Walter Bright wrote:
> On 8/26/2021 2:38 AM, deadalnix wrote:
>> I can work with having to pass the -main flag. This is not 
>> ideal, because what else could I possibly want?
>
> Then we'll get a bug report where the user compiled a module, 
> and it compiled and linked without error, then he runs the 
> program and nothing happens because the compiler inserted an 
> empty main().

No, because it'll run the unittests, and the user will see "X 
test passed" or something similar when running the executable, 
understand that they ran the uni tests and go ahead and run the 
executable that has been built without the unitests flag.

If the user doesn't have any unitests in the executable, then 
saying "0 test run, 0 passed, 0 failed" is enough to indicated to 
the user that this was a unitests build.


More information about the Digitalmars-d mailing list