Re: Running unittests in a D library

2013-11-08 Thread Flamaros
On Thursday, 20 September 2012 at 18:31:38 UTC, Jacob Carlborg wrote: On 2012-09-20 13:14, Jonathan M Davis wrote: On Thursday, September 20, 2012 12:34:50 Johannes Pfau wrote: But it should be possible. I'm not arguing that it shouldn't be possible. I'm just pointing out that it wouldn't

Re: Running unittests in a D library

2012-09-20 Thread Jacob Carlborg
On 2012-09-20 01:56, Jonathan M Davis wrote: Yes. But the solution then is to not unit test your library that way. You build it as a binary with an empty main and run that. It may be that compiling it as a library and then linking should work, but unless you want to have the unit test stuff

Re: Running unittests in a D library

2012-09-20 Thread Johannes Pfau
Am Wed, 19 Sep 2012 12:34:18 -0700 schrieb Jonathan M Davis jmdavisp...@gmx.com: On Wednesday, September 19, 2012 20:50:08 Chris Molozian wrote: Hey all, I'm sure that this is a rather daft question but I've tried to search the d.learn mailing list and must have missed a question

Re: Running unittests in a D library

2012-09-20 Thread Jonathan M Davis
On Thursday, September 20, 2012 12:34:50 Johannes Pfau wrote: But it should be possible. I'm not arguing that it shouldn't be possible. I'm just pointing out that it wouldn't really be useful. You have to build at least two versions of your library anyway (one with -unittest and one without),

Re: Running unittests in a D library

2012-09-20 Thread Jacob Carlborg
On 2012-09-20 13:14, Jonathan M Davis wrote: On Thursday, September 20, 2012 12:34:50 Johannes Pfau wrote: But it should be possible. I'm not arguing that it shouldn't be possible. I'm just pointing out that it wouldn't really be useful. You have to build at least two versions of your library

Running unittests in a D library

2012-09-19 Thread Chris Molozian
Hey all, I'm sure that this is a rather daft question but I've tried to search the d.learn mailing list and must have missed a question about it. I've read the unit testing documentation on dlang.org and I know that `unittest { /* some code */ }` blocks are compiled into the executable and

Re: Running unittests in a D library

2012-09-19 Thread Chris Molozian
Actually after more digging it seems that unit testing libraries in D doesn't work. It seems pretty bad that in 2012 with unit testing a huge part of the software development process and D describing itself as a language with unit testing built in, this bug report / feature request hasn't

Re: Running unittests in a D library

2012-09-19 Thread Jonathan M Davis
On Wednesday, September 19, 2012 20:50:08 Chris Molozian wrote: Hey all, I'm sure that this is a rather daft question but I've tried to search the d.learn mailing list and must have missed a question about it. I've read the unit testing documentation on dlang.org and I know that

Re: Running unittests in a D library

2012-09-19 Thread Jacob Carlborg
On 2012-09-19 21:34, Jonathan M Davis wrote: You don't build it as a library when your unit testing it. You create an empty main, compile it all as an executable, and run it. I believe that rdmd --main will do this for you (rdmd comes with dmd), but I haven't really used rdmd, so I'm not 100%

Re: Running unittests in a D library

2012-09-19 Thread Jonathan M Davis
On Wednesday, September 19, 2012 21:49:19 Jacob Carlborg wrote: On 2012-09-19 21:34, Jonathan M Davis wrote: You don't build it as a library when your unit testing it. You create an empty main, compile it all as an executable, and run it. I believe that rdmd --main will do this for you

Re: Running unittests in a D library

2012-09-19 Thread Nathan M. Swan
On Wednesday, 19 September 2012 at 18:49:12 UTC, Chris Molozian wrote: Hey all, I'm sure that this is a rather daft question but I've tried to search the d.learn mailing list and must have missed a question about it. I've read the unit testing documentation on dlang.org and I know that