Re: Shared static this() not executed for unittest

2018-12-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, December 16, 2018 12:53:43 PM MST Steven Schveighoffer via Digitalmars-d-learn wrote: > On 12/15/18 5:14 PM, Jonathan M Davis wrote: > > On Saturday, December 15, 2018 10:27:36 AM MST Neia Neutuladh via > > > > Digitalmars-d-learn wrote: > >> On Sat, 15 Dec 2018 17:19:05 +, Timoses

Re: Shared static this() not executed for unittest

2018-12-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/15/18 5:14 PM, Jonathan M Davis wrote: On Saturday, December 15, 2018 10:27:36 AM MST Neia Neutuladh via Digitalmars-d-learn wrote: On Sat, 15 Dec 2018 17:19:05 +, Timoses wrote: Running `dub test` will output: Running ./unit-test-library writeln: unittest All unit tests have been run

Re: Shared static this() not executed for unittest

2018-12-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, December 15, 2018 10:27:36 AM MST Neia Neutuladh via Digitalmars-d-learn wrote: > On Sat, 15 Dec 2018 17:19:05 +, Timoses wrote: > > Running `dub test` will output: > > Running ./unit-test-library writeln: unittest All unit tests have been > > run successfully. > > > > Why is the

Re: Shared static this() not executed for unittest

2018-12-15 Thread Timoses via Digitalmars-d-learn
A look into `dub test --vverbose` showed that ./source/app.d is not even included in the compilcation step...

Re: Shared static this() not executed for unittest

2018-12-15 Thread Neia Neutuladh via Digitalmars-d-learn
On Sat, 15 Dec 2018 17:19:05 +, Timoses wrote: > Running `dub test` will output: > Running ./unit-test-library writeln: unittest All unit tests have been > run successfully. > > Why is the `shared static this()` not executed? Run `dub clean; dub test -v` and you'll see that main.d isn't compi

Shared static this() not executed for unittest

2018-12-15 Thread Timoses via Digitalmars-d-learn
Spec 27.5 states: "Unit tests, when enabled, are run after all static initialization is complete and before the main() function is called. " (https://dlang.org/spec/unittest.html) main.d: --- import std.stdio; shared static this() { import vibe.core.log; setLogLevel(Lo