http://d.puremagic.com/issues/show_bug.cgi?id=6464

           Summary: Unittests in libraries isn't run
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nob...@puremagic.com
        ReportedBy: simend...@gmail.com


--- Comment #0 from simendsjo <simend...@gmail.com> 2011-08-10 03:30:47 PDT ---
Ref:
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.learn&artnum=28755

Is it possible to run unittests in libraries?
The following doesn't work:

l.d
===
module l;
import std.stdio;
int f() { return 1; } // just to make sure it's actually compiled in
unittest {
    writeln("Unittest from lib");
    assert(false);
}


t.d
===
import l;
import std.stdio;
void main() {
    writeln(f());
}


> dmd -unittest -lib l
> dmd -unittest t l.lib
> t.exe
1 // should write "Unittest from lib" and assert

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to