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

           Summary: Unit tests do not work in libraries compiled by dmd
                    with -lib
           Product: D
           Version: D1 & D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: mike.linf...@gmail.com


--- Comment #0 from Mike Linford <mike.linf...@gmail.com> 2010-08-17 08:55:13 
PDT ---
The following unit test in mylib.d is not run:

mylib.d:

  1 module mylib;
  2
  3 void blah()
  4 {
  5 }
  6 unittest
  7 {
  8    assert(false);
  9 }
 10

test.d:

  1 module test;
  2
  3 import mylib;
  4
  5 void main()
  6 {
  7    blah();
  8 }
  9


Makefile:
  1 test : mylib.a test.d
  2    dmd -unittest test.d mylib.a
  3
  4 mylib.a : mylib.d
  5    dmd -unittest -lib mylib.d
  6
  7 clean :
  8    rm -f test mylib.a *.o
  9

However, it WILL be run if the project is compiled as follows:

dmd -unittest -c mylib.d
ar -rc mylib.a mylib.o
dmd -unittest test.d mylib.a

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

Reply via email to