On Monday, 21 March 2016 at 10:29:36 UTC, Nordlöw wrote:
I want to enable unittests only at the top-level of a module compilation.

If I have a module

    top.d

that imports

    dep1.d
    dep2.d
    ...

which all contain unittests, how do I compile top.d with only the unittests for top.d enabled?

Version the unittests, perhaps.

module depN;

version (TestDeps)
unittest {
    // ...
}

Then dmd -unittest -version=TestDeps if you want them run.

Reply via email to