c++ - Boost unit test failure detected in wrong test suite -


How do I use the Boost Test Library at this time, and I can not seem to get the exam suite right Work the way the following code fails correctly in 'test_case_1' but it has been reported in the Master Test suite instead of 'test_suite_1'.

Anyone know what I'm doing Am I

  #define BOOST_AUTO_TEST_MAIN #include & lt; Boost / test / auto_unit_test.hpp & gt; 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:  

Edit:

The answer to the ovens has prompted me to understand the suite hierarchy better - in this case the test_suite_1 sub-suite of the root suite is the default form The name 'Master Test Suite' shows the default logging only the root suite, which is what I do not expect from it. I) It can be settled by:

You define the BOOST_TEST_MODULE You can set the original suite name Express an alternate version of the example which required error message:

  #define BOOST_TEST_MODULE test_suite_1 #define BOOST_AUTO_TEST_MAIN #include & lt; Boost / test / auto_unit_test.hpp & gt; BOOST_AUTO_TEST_CASE (test_case_1) {BOOST_REQUIRE_EQUAL (1, 2); }  

It depends on how you configure your logger to create a report For example, for example --log_level = All results will be in the following output:

  1 test case is running ... Access to the test suite "Master Test Suits" exam Entering the Suite "test_suite_1" Entering test case "test_case_1" d: /projects/cpp/test/main.cpp (9): Critical error in "test_case_1": Important Anc 1 == 2 failed [1! = 2] Excluding the test case "test_case_1" is leaving the test suite "Test_suite_1" leaving the test suite "Master Test Suit" *** 1 failure in the test suite "Master Test Suit" detected  
< P> Here is the link to the command line configuration option.

Regards,
Owens


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -