[test] spread case over multiple translation units

Is it possible have multiple cpp's linked for a single master test suite? Doing the naive below results int multiply defined symbols linker errror. See below: suite1.cpp ------------------------------------- #define BOOST_TEST_MAIN #define BOOST_TEST_MODULE Master #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(Sweet1) BOOST_AUTO_TEST_CASE(TestCase1) { BOOST_CHECK (true); BOOST_REQUIRE(true); BOOST_REQUIRE(true); BOOST_CHECK (true); } BOOST_AUTO_TEST_CASE(TestCase2) { BOOST_CHECK (true); BOOST_REQUIRE(true); BOOST_REQUIRE(true); BOOST_CHECK (true); } BOOST_AUTO_TEST_SUITE_END() suite2.cpp ------------------------------------------ #define BOOST_TEST_MAIN #define BOOST_TEST_MODULE Master #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(Sweet2) BOOST_AUTO_TEST_CASE(TestCaseA) { BOOST_CHECK (true); BOOST_REQUIRE(true); BOOST_REQUIRE(true); BOOST_CHECK (true); } BOOST_AUTO_TEST_CASE(TestCaseB) { BOOST_CHECK (true); BOOST_REQUIRE(true); BOOST_REQUIRE(true); BOOST_CHECK (true); } BOOST_AUTO_TEST_SUITE_END()

Jeff Flinn wrote:
Is it possible have multiple cpp's linked for a single master test suite? Doing the naive below results int multiply defined symbols linker errror. See below:
suite1.cpp ------------------------------------- #define BOOST_TEST_MAIN #define BOOST_TEST_MODULE Master
Ahh, I see the above should only appear in one translation unit. Thanks, Jeff
participants (1)
-
Jeff Flinn