I'm looking for recommendations on how to physically/logically organize the
TestCases (or should I be using TestFixtures now, I'm still at version
CppUnit v1.7)
when using static and/or dynamic libraries. Suppose you have a LibA:
--- a.h ---
#ifndef ....
#include <LibA/Common.h>
namespace LibA { class a { ... }; }
#endif
--- end a.h ---
Simple enough - but where do the tests belong. It feels natural to include
the test code in the library, but I see some downsides to this:
1) You still can't 'run the library' to run the tests. You'll need a
testdriver application (so why not put the tests in the testdriver).
2) Code bloat and added complexity for those who don't want to
see/redistribute the tests (in the case of dynamic libraries)
3) I kinda' like the CPPUNIT_REGISTER_xxx macros.
Are there any de-facto standards on how to organize, maintain and
(redistribute) the test cases when working with medium-to large scale
applications / libraries?
TIA // Johan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm looking for recommendations on how to physically/logically organize the
TestCases (or should I be using TestFixtures now, I'm still at version
CppUnit v1.7)
when using static and/or dynamic libraries. Suppose you have a LibA:
--- a.h ---
#ifndef ....
#include <LibA/Common.h>
namespace LibA { class a { ... }; }
#endif
--- end a.h ---
--- a.cpp ---
#include <LibA/a.h>
LibA:🅰:a() {}
--- end a.cpp ---
Simple enough - but where do the tests belong. It feels natural to include
the test code in the library, but I see some downsides to this:
1) You still can't 'run the library' to run the tests. You'll need a
testdriver application (so why not put the tests in the testdriver).
2) Code bloat and added complexity for those who don't want to
see/redistribute the tests (in the case of dynamic libraries)
3) I kinda' like the CPPUNIT_REGISTER_xxx macros.
Are there any de-facto standards on how to organize, maintain and
(redistribute) the test cases when working with medium-to large scale
applications / libraries?
TIA // Johan