How can one reliably run unittests

Steven Schveighoffer schveiguy at gmail.com
Fri Aug 27 00:44:03 UTC 2021


On 8/26/21 12:12 AM, Mathias LANG wrote:
> On Wednesday, 25 August 2021 at 11:11:24 UTC, Steven Schveighoffer wrote:
>> Disagree. I'm fine with the simple unittest experience, and avoiding 
>> putting all this kind of bloat into the runtime.
>>
> 
> What bloat ? Is it the amount of code needed, or the binary size that 
> bothers you ?

unittesting code is in the binary whether unittests are run or not. 
Whether unittests should be run is all decided at runtime.

But also, what I meant is, if you are going to include all the parts to 
colorize things, that now needs to be part of druntime.

> For the former, we already have many framework doing this, so there's a 
> real interest in having it, and having it in a single place means that 
> improvements will be centralized, instead of being duplicated. So, less 
> code bloat when you look at the big picture.

This is different, because the language doesn't have to include the 
framework to do it. You can write this separately.

> For the later, I've never seen anyone bother about unittest binary size. 
> I don't think we should. And if the unittest framework code ends up in 
> the binary when `-unittest` is not used, we're doing it wrong.

unittest framework code exists whether we are unittesting or not. And 
yet more seemingly unrelated "druntime" modules need to be built.

-Steve


More information about the Digitalmars-d mailing list