User forums > Using Code::Blocks

Help - unit testing with Code::Blocks, WxWidgets and UnitTest++

<< < (2/2)

oBFusCATed:
you've got tons of possibilities :)

1. could create another application
2. could add command line argument (-test) that does it
3. something else

Most people settle on option 1. and it is explained in the tutorial about unittest++

Otto:
Option 2 seems a bit odd to me. Command line argument during development using an IDE?

About option 1, I would have a project for unittest++, another for my unit tests and a third one for the project itself? Not exactly as the tutorial.

oBFusCATed:
The idea is to add a post build step that executes the unittest project.
The unittest project reports errors similar to your to the errors produced by the compiler, this way you can click them in the IDE
and it will go to the line with the failing test.

The tutorial is missing the real project :)

killerbot:
note also, that typically a bunch of functionality is implemented in a library. Then the setup would even be little more different.
1) project that builds *my* library
2) test project (console app) that contains the tests, these will include the exported headers from the library, and will link with the library binary

the tutorial  is a simplification, in that way that the test code and the tested code all belong to the same (console app) project.

Otto:
So the library is the wx project (both GUI and core classes) and a second project with the unit tests.
I'll try and see what I can do.

Thanks.

Navigation

[0] Message Index

[*] Previous page

Go to full version