Why think unit tests should be in their own source code hierarchy instead of side-by-side

Anton Fediushin fediushin.anton at yandex.ru
Thu Mar 22 17:29:52 UTC 2018


On Thursday, 22 March 2018 at 17:15:55 UTC, Anton Fediushin wrote:
> So? Am I wrong about dub? Let me investigate

I'm not wrong! It works as expected: only package you are working 
with compiles with `-unittest` option.

Test repo: 
https://github.com/ohdatboi/dub-please-be-as-cool-as-i-think-you-are

Cd to `app` directory and run:
---
$ dub
Performing "debug" build using /usr/bin/dmd for x86_64.
lib1 ~master: building configuration "library"...
lib1: Compiled without -unittest option
app ~master: building configuration "application"...
app: Compiled without -unittest option
Linking...
Running ./app
---

---
$ dub -b unittest
Performing "unittest" build using /usr/bin/dmd for x86_64.
lib1 ~master: building configuration "library"...
lib1: Compiled without -unittest option
app ~master: building configuration "application"...
app: Compiled with -unittest option
Linking...
Running ./app
---

Oh heck yeah! I think that dub is only one of the D tools which 
never disappoints me.


More information about the Digitalmars-d-announce mailing list