Unit tests in libraries?
Stephan
spam at extrawurst.org
Tue Aug 17 03:38:32 PDT 2010
Yeah unittests in compiled static librarys do not work as of dmd2048
right now. please file a bug report with that code.
On 17.08.2010 04:24, Mike Linford wrote:
> On Mon, 16 Aug 2010 17:38:28 -0700, Walter Bright wrote:
>
>> Mike Linford wrote:
>>> Is it working as it should by not including the unit tests with:
>>>
>>> dmd -unittest -lib mylib.d
>>>
>>> ?
>>
>> That should work.
>
> Yeah, I'm not sure what I'm doing wrong. Can someone else try this out?
>
> 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
>
>
More information about the Digitalmars-d
mailing list