Exemple #1
0
 // Called after a failed assertion or a SUCCEED() invocation.
 virtual void OnTestPartResult(
     const ::testing::TestPartResult& result)
 {
     if (result.failed()) {
         printf("UNEXPECTED FAILURE in %s:%d\n%s\n",
                result.file_name(), result.line_number(), result.summary());
     }
 }
    // Called after a failed assertion or a SUCCEED() invocation.
    virtual void OnTestPartResult(
            const ::testing::TestPartResult& test_part_result)
    {
//        if(mProcId == 0)
        {
            printf("%s on proc %d in %s:%d\n%s\n",
                    test_part_result.failed() ? "*** Failure" : "*** Success",
                    mProcId,
                    test_part_result.file_name(),
                    test_part_result.line_number(),
                    test_part_result.summary());
        }
    }
Exemple #3
0
	// Called after a failed assertion or a SUCCEED() invocation.
	// Note: One test can have many invocations of SUCCEED() and also loops
	virtual void OnTestPartResult( const ::testing::TestPartResult& test_part_result)
	{
		if (test_part_result.failed())
		{
			m_has_errors = true;
		}
	}
Exemple #4
0
        virtual void OnTestPartResult(const testing::TestPartResult& testPartResult)
        {
            std::stringstream s;
            std::string filename = testPartResult.file_name() ? testPartResult.file_name() : "<unknown file>";
            int line_number = testPartResult.line_number();
            std::string summary = testPartResult.summary() ? testPartResult.summary() : "<no description of error>";
            s << "\tTest ["
                << (is_google_test ? (GoogleTestCase + "::") + GoogleTestName : std::string())
                << "] " << (testPartResult.failed() ? "FAILED" : "PASSED") << ":\n\t"
                << filename
                << "("
                << line_number
                << ")\n\t"
                << boost::replace_all_copy(summary, "\n", "\n\t")
                << std::endl;

            BOOST_CHECK_MESSAGE(false, s.str());
#if defined(UNICODE)
            std::string sstr = s.str();
            std::wstring ws(sstr.size(), L' ');
            ws.resize(mbstowcs(&ws[0], sstr.c_str(), sstr.size()));
            output_debug_string(ws.c_str());
#else
            output_debug_string(s.str().c_str());
#endif
        }
 // GoogleTest listener APIs
 virtual void OnTestPartResult(const testing::TestPartResult & result) {
     if (!result.failed() || this->exception != nullptr) return;
     this->exception = new bandit::detail::assertion_exception(result.summary(), result.file_name(), result.line_number());
 }
void MinimalistPrinter::OnTestPartResult(const ::testing::TestPartResult &test_part_result) {
  if (test_part_result.failed()) {
    _impl->_tests[_impl->_current_test].push_back(test_part_result);
  }
}
void XITServerTest::OnTestPartResult(const ::testing::TestPartResult &test_part_result) {
    failed = failed || test_part_result.failed();
}