Re: Running unittests of a module with -betterC

2019-10-30 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 18:45:50 UTC, Jacob Carlborg wrote: On 2019-10-30 16:09, jmh530 wrote: I feel like this should be added into the compiler so that it just works. This will only run the unit tests in the current modules. The standard way of running the unit tests will run the

Re: Running unittests of a module with -betterC

2019-10-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-10-30 16:09, jmh530 wrote: I feel like this should be added into the compiler so that it just works. This will only run the unit tests in the current modules. The standard way of running the unit tests will run the unit tests in all modules. -- /Jacob Carlborg

Re: Running unittests of a module with -betterC

2019-10-30 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 15:09:40 UTC, jmh530 wrote: [snip] I feel like this should be added into the compiler so that it just works. Hmm, maybe only when compiled with -main, but I don't think there's a version for that.

Re: Running unittests of a module with -betterC

2019-10-30 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 29 October 2019 at 08:45:15 UTC, mipri wrote: [snip] -unittest sets the 'unittest' version identifier. So this works: unittest { assert(0); } version(unittest) { extern(C) void main() { static foreach(u; __traits(getUnitTests, __traits(parent, main)))

Re: Running unittests of a module with -betterC

2019-10-29 Thread mipri via Digitalmars-d-learn
On Monday, 28 October 2019 at 08:51:02 UTC, Daniel Kozak wrote: On Mon, Oct 28, 2019 at 9:40 AM Per Nordlöw via Digitalmars-d-learn wrote: Is it possible to run the unittests of a module with -betterC like dmd -D -g -main -unittest -betterC f.d ? This currently errors as

Re: Running unittests of a module with -betterC

2019-10-28 Thread Daniel Kozak via Digitalmars-d-learn
On Mon, Oct 28, 2019 at 9:40 AM Per Nordlöw via Digitalmars-d-learn wrote: > > Is it possible to run the unittests of a module with -betterC like > > dmd -D -g -main -unittest -betterC f.d > > ? > > This currently errors as > > /usr/include/dmd/druntime/import/core/internal/entrypoint.d:34:

Running unittests of a module with -betterC

2019-10-28 Thread Per Nordlöw via Digitalmars-d-learn
Is it possible to run the unittests of a module with -betterC like dmd -D -g -main -unittest -betterC f.d ? This currently errors as /usr/include/dmd/druntime/import/core/internal/entrypoint.d:34: error: undefined reference to '_d_run_main' for an empty file f.d