How can one reliably run unittests

deadalnix deadalnix at gmail.com
Thu Sep 2 18:01:34 UTC 2021


On Thursday, 2 September 2021 at 17:51:10 UTC, jfondren wrote:
> This is the only reasonable outcome from this combination of 
> flags. Not everything that ever surprises you is nonsense. If 
> you're not familiar with how dmd works, then being surprised is 
> just part of learning how it works.
>

No, it clearly isn't. In fact, there are exactly 0 use case for 
what this combination of flag is doing and 0 combination of flags 
for use cases that exist in the wild.

If you don't see the problem, I don't know what to tell you. 
Maybe "Please do not design any software that is meant to be used 
by anyone ever, thanks".

> Yep. That's what -run does. It passes the remaining commandline 
> to the program to be run.
>
>> This is complete nonsense
>
> The only *conceivable* alternative to this "complete nonsense" 
> is to always require a -- separator, which dub does, which is 
> more an artifact of getopt-style commandline processing than 
> the outcome of a thoughtfully designed CLI.
>

Once again, snap out of whatever mindset you are in. This is 
*OBVIOUSLY* nonsense because there is *NO PROGRAM TO BE RUN*. The 
compiler know this because I had to pass the -main flag to begin 
with.

There is *NO MAIN* there is *NO EXPECTATION THAT ANY MAIN IS RUN* 
so passing argument to it simply does not make sense.

As Pauli would say, it's not even wrong.


Think of it this way. There is a unitest feature in the language. 
There are literally no way to tell the compiler "please run the 
unitests for this set of module". Or if there is one, it is so 
bizantine that nobody seems to be able to figure it out. This is 
a 7 pages long thread about it, full of D experts, and yet, 
nobody knows how to do this simple task.


More information about the Digitalmars-d mailing list