<p dir="ltr">Can you not just change to going through each module running the hosts manually? Then you can do what you like before and after each.</p>
<p dir="ltr">If your lib had  a host that started a thread which received messages about a unittest registering itself in other user modules you could run the unittests as  you feel like and you could stick with the -unittest dmd arg. <br>

Reason for the thread is you can't control order of module initialization. </p>
<div class="gmail_quote">On 23 Sep 2013 21:30, "Gary Willoughby" <dev@nomad.so> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Monday, 23 September 2013 at 16:40:56 UTC, jostly wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Let's not end up in that situation, but rather work out a common API to run unit tests, and the D unit test community can be the envy of every other unit tester. :)<br>
</blockquote>
<br>
You've raised some nice ideas and got me thinking. However, i do think we are missing some way of knowing when unit tests start and stop. I like the built in unittest blocks but it would be nice to have something like:<br>

<br>
    beforetests<br>
    {<br>
        ...<br>
    }<br>
<br>
    aftertests<br>
    {<br>
        ...<br>
    }<br>
<br>
To apply code before and after the unit tests have run. These could be used to setup and the execute the reporting environment? I can't think of a way to do this automatically without these constructs.<br>
</blockquote></div>