I am learning how to use the Boost test library at the moment, and I cannot get the test suites to work correctly. The following code "test_case_1" crashes, but it is reported as being in the Master Test Suite instead of "test_suite_1".
Does anyone know what I'm doing wrong?
#define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp>
BOOST_AUTO_TEST_SUITE(test_suite_1);
BOOST_AUTO_TEST_CASE(test_case_1) {
BOOST_REQUIRE_EQUAL(1, 2);
}
BOOST_AUTO_TEST_SUITE_END();
edit:
Ovanes answer led me to understand the package hierarchy better - in this case test_suite_1 is the subnet of the root package, which is called the “Master Test Suite” by default. The default protocol displays only the root package, which I did not expect from it. I can handle it :)
, BOOST_TEST_MODULE - , :
#define BOOST_TEST_MODULE test_suite_1
#define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp>
BOOST_AUTO_TEST_CASE(test_case_1) {
BOOST_REQUIRE_EQUAL(1, 2);
}