"Gennadiy Rozental" writes:
I haven't figured out how to set things up so that I can compile individual
tests to .o files and then either simply build a complete regression suite
executable from them or an executable from just one (or a few) of these
tests; because I don't know how to use the autoregistration facilities
without ending up with multiple main()s.
[...]
Define BOOST_TEST_MODULE only in single file of your multi-file test module.
Thanks for the help. I guess that means that I'm going to setup things so that
I have a single run_tests.cpp that just looks like so:
#define BOOST_TEST_MODULE test_everything
#include
and only vary the make target; i.e. what I link against it (just a single/few
test-file(s) during development or the complete regression suite). Does this
sound sensible?
Another option might be to always build the complete regression test and then
pass a string/regexp on the commandline to specify what suite/testcase(s) to
run, but as far as I can tell that isn't yet supported out of the box, and
would likely require more work than above approach, right?
Also, from reading the docs I get the impression that it isn't (easily)
possible to span tests suites over multiple files, unless one forgoes the
convenience of BOOST_AUTO_TEST_CASE/SUITE -- e.g.. I can't just use
//file1.cpp
BOOST_AUTO_TEST_SUITE(foo_suite)
[...]
BOOST_AUTO_TEST_SUITE_END()
//file2.cpp
BOOST_AUTO_TEST_SUITE(foo_suite)
[...]
BOOST_AUTO_TEST_SUITE_END()
to automagically either add more tests to foo_suite or create it if it hasn't
been previously defined?
thanks,
'as