Am 16.04.2014 15:46, schrieb Casey:

I'm still getting an issue where it tells me I can't have more than one main when I run "dub test". Can you tell me what I'm doing wrong? Here's the test main class that I created:

 module test;

 version (unittest)
 {
     import tested;
     import std.exception;

     shared static this()
     {
         // disable built-in unit test runner
         import core.runtime;
         Runtime.moduleUnitTester = () => true;
     }

 }

 void main()
 {
     version(unittest)
     {
         enforce(runUnitTests!test(new
                 JsonTestResultWriter("results.json")), "Unit tests failed.");
     }
 }

And here's my dub.json:

 {
     "name": "test",
     "description": "A simple vibe.d server application.",
     "copyright": "Copyright © 2014, dev",
     "authors": ["dev"],
     "dependencies": {
         "vibe-d": ">=0.7.18",
         "tested": ">=0.9.3"
},
     "configurations": [
         {
             "name": "test",
             "mainSourceFile": "source/test.d"
         }
     ]
 }

dub version 0.9.21.

Try inserting "excludedSourceFiles": ["source/app.d"] (or whichever
file matches your usual main module) into the "test" configuration - I
think it still picks up that one.