Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BoostTestAdapter
- : public ::testing::EmptyTestEventListener {
- void OnTestPartResult(const ::testing::TestPartResult& testPartResult) {
- if (!testPartResult.failed()) return;
- ::boost::test_tools::tt_detail::check_impl(
- false,
- ::boost::unit_test::lazy_ostream::instance() << testPartResult.summary(),
- testPartResult.file_name(),
- testPartResult.line_number(),
- ::boost::test_tools::tt_detail::CHECK,
- ::boost::test_tools::tt_detail::CHECK_MSG,
- 0);
- }
- };
- struct GoogleMockFixture {
- GoogleMockFixture() {
- ::testing::InitGoogleMock(
- &boost::unit_test::framework::master_test_suite().argc,
- boost::unit_test::framework::master_test_suite().argv);
- ::testing::TestEventListeners &listeners = ::testing::UnitTest::GetInstance()->listeners();
- delete listeners.Release(listeners.default_result_printer());
- listeners.Append(new BoostTestAdapter);
- }
- ~GoogleMockFixture() {}
- };
- BOOST_GLOBAL_FIXTURE(GoogleMockFixture)
Add Comment
Please, Sign In to add comment