digitalmars.D.learn - Unit tests for libraries
- Sebastian Beschke (7/7) May 14 2005 Hi,
- Derek Parnell (12/18) May 14 2005 No, I don't think so.
- Sebastian Beschke (3/11) May 14 2005 Yeah, that sounds OK. Thanks :)
- Brian White (7/11) May 16 2005 What I do is, after building the library, is link all of the .o files
Hi, I'm still having problems understanding how unit tests work. I'm trying to incorporate unit tests into a library. Is there any way to create an executable that runs the unit tests, without linking an extra main() function in? I haven't yet found a way to do this. Thanks, Sebastian
May 14 2005
On Sat, 14 May 2005 15:08:22 +0200, Sebastian Beschke wrote:Hi, I'm still having problems understanding how unit tests work. I'm trying to incorporate unit tests into a library. Is there any way to create an executable that runs the unit tests, without linking an extra main() function in? I haven't yet found a way to do this.No, I don't think so. You might try something like this ... version(mytest) { void main(){} } then compile the library with -version=mytest -unittest -- Derek Parnell Melbourne, Australia 14/05/2005 11:49:11 PM
May 14 2005
Derek Parnell schrieb:You might try something like this ... version(mytest) { void main(){} } then compile the library with -version=mytest -unittestYeah, that sounds OK. Thanks :) -Sebastian
May 14 2005
I'm still having problems understanding how unit tests work. I'm trying to incorporate unit tests into a library. Is there any way to create an executable that runs the unit tests, without linking an extra main() function in? I haven't yet found a way to do this.What I do is, after building the library, is link all of the .o files along with "testmain.o". That creates a standard library and also an executable to run the unit tests. Brian ( bcwhite precidia.com ) ------------------------------------------------------------------------------- Differences are good. If two people agree, one of them is redundant.
May 16 2005