[test]about the usage of BOOST_AUTO_TEST_SUITE

here is my code: BOOST_AUTO_TEST_SUITE(myTestSuite) BOOST_AUTO_TEST_CASE(myFirstTestCase) { BOOST_CHECK_EQUAL(5, 2); } BOOST_AUTO_TEST_SUITE_END() the output is : Running 1 test case... d:/test/test.cpp(35): error in "myFirstTestCase": check 5 == 2 failed [5 != 2] *** 1 failure detected in test suite "Master Test Suite" so, my question is, why is the test case's name "myFirstTestCase", but the test suite's name changed into "Master Test Suite"? do i use the BOOST_AUTO_TEST_SUITE in a wrong way? if so, what's the correct usage? thanks in advance. -- Best Regards, Leo Jay

"Leo Jay" <python.leojay@gmail.com> wrote in message news:4e307e0f0701082320x5353fcc4t94a9ec5912ed84b7@mail.gmail.com...
here is my code:
BOOST_AUTO_TEST_SUITE(myTestSuite)
BOOST_AUTO_TEST_CASE(myFirstTestCase) { BOOST_CHECK_EQUAL(5, 2); }
BOOST_AUTO_TEST_SUITE_END()
the output is : Running 1 test case... d:/test/test.cpp(35): error in "myFirstTestCase": check 5 == 2 failed [5 != 2]
*** 1 failure detected in test suite "Master Test Suite"
so, my question is, why is the test case's name "myFirstTestCase", but the test suite's name changed into "Master Test Suite"?
The test suite name did not change. The master test suite is always present and is the root of test tree hierarhy. Your test suite is it's child. To see complete hierarhy you need to specify --report_level=detailed
do i use the BOOST_AUTO_TEST_SUITE in a wrong way? if so, what's the correct usage?
You don't really need BOOST_AUTO_TEST_SUITE here (at least in an example above). Here how it could look: #define BOOST_TEST_MODULE myTestSuite #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_CASE(myFirstTestCase) { BOOST_CHECK_EQUAL(5, 2); } Try to run this a tell me is an output is what you want. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Leo Jay