boost-unit-test-framework

How do I get BOOST_TEST_MESSAGE to display on the screen?

社会主义新天地 提交于 2020-01-01 09:07:05
问题 I'm fumbling my way through the Boost Unit Testing Framework and have set up a basic functioning unit test. I'm using BOOST_TEST_MESSAGE to let the user know which tests are running, but the messages don't display on the screen. For example: #define BOOST_TEST_MODULE MyTest #include <boost/test/included/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(MyTestSuite, MyTestFixture) BOOST_AUTO_TEST_CASE(MessageTest) { BOOST_TEST_MESSAGE( "no one sees this!" ); } BOOST_AUTO_TEST_SUITE_END(); I have tried

How do I get BOOST_TEST_MESSAGE to display on the screen?

*爱你&永不变心* 提交于 2020-01-01 09:06:13
问题 I'm fumbling my way through the Boost Unit Testing Framework and have set up a basic functioning unit test. I'm using BOOST_TEST_MESSAGE to let the user know which tests are running, but the messages don't display on the screen. For example: #define BOOST_TEST_MODULE MyTest #include <boost/test/included/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(MyTestSuite, MyTestFixture) BOOST_AUTO_TEST_CASE(MessageTest) { BOOST_TEST_MESSAGE( "no one sees this!" ); } BOOST_AUTO_TEST_SUITE_END(); I have tried

google mock with boost::test causes memory leak

跟風遠走 提交于 2019-12-12 04:44:34
问题 I am trying to create unit tests using boost::test and google mock. Adding a call to InitGoogleMock causes boost to signal some memory leaks. I searched for some sort of "DeInitGoogleMock" but didn't find any. Why does this memory leak come up? How can it be fixed? main.cpp: #include <gmock/gmock.h> #define BOOST_TEST_MODULE my_testt #include <boost/test/unit_test.hpp> struct InitGMock { InitGMock() { ::testing::GTEST_FLAG(throw_on_failure) = true; //::testing::InitGoogleMock(&boost::unit

How do I get BOOST_TEST_MESSAGE to display on the screen?

混江龙づ霸主 提交于 2019-12-04 03:29:05
I'm fumbling my way through the Boost Unit Testing Framework and have set up a basic functioning unit test. I'm using BOOST_TEST_MESSAGE to let the user know which tests are running, but the messages don't display on the screen. For example: #define BOOST_TEST_MODULE MyTest #include <boost/test/included/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(MyTestSuite, MyTestFixture) BOOST_AUTO_TEST_CASE(MessageTest) { BOOST_TEST_MESSAGE( "no one sees this!" ); } BOOST_AUTO_TEST_SUITE_END(); I have tried defining BOOST_TEST_LOG_LEVEL to all but this has no effect. I got that idea from the Boost log-level

How to compare vectors with Boost.Test?

蹲街弑〆低调 提交于 2019-12-03 06:58:08
问题 I am using Boost Test to unit test some C++ code. I have a vector of values that I need to compare with expected results, but I don't want to manually check the values in a loop: BOOST_REQUIRE_EQUAL(values.size(), expected.size()); for( int i = 0; i < size; ++i ) { BOOST_CHECK_EQUAL(values[i], expected[i]); } The main problem is that the loop check doesn't print the index, so it requires some searching to find the mismatch. I could use std::equal or std::mismatch on the two vectors, but that