Esempio n. 1
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
        }
Esempio n. 2
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());
        }
    }
 // 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());
 }