Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 14, 2005 Unit tests for libraries | ||||
---|---|---|---|---|
| ||||
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 Re: Unit tests for libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastian Beschke | 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 Re: Unit tests for libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | Derek Parnell schrieb:
> You might try something like this ...
>
> version(mytest)
> {
> void main(){}
> }
>
> then compile the library with -version=mytest -unittest
Yeah, that sounds OK. Thanks :)
-Sebastian
|
May 16, 2005 Re: Unit tests for libraries | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastian Beschke | > 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. |
Copyright © 1999-2021 by the D Language Foundation