void PrettyResultPrinter::OnTestCaseStart(const testing::TestCase& pTestCase) { testing::Log::getOStream() << Color::GREEN << "[----------] " << Color::YELLOW; int num_tests = pTestCase.getNumOfTests(); if (1 == num_tests) testing::Log::getOStream() << "1 test from "; else if (1 < num_tests) testing::Log::getOStream() << num_tests << " tests from "; testing::Log::getOStream() << pTestCase.getCaseName() << "." << Color::RESET << std::endl; }
void VisualUnitTestResultWriter::OnTestCaseEnd( const ::testing::TestCase& test_info ) { Path p; File fp; ImageTestSet set1; ImageTestSet set2; IValueDeserializer* in = nullptr; TestResultWriter* os = nullptr; // We cannot generate test results output if we do not have reference images // for comparison! if( NOM_TEST_FLAG(reference_screenshot) == true ) { return; } if( NOM_TEST_FLAG(disable_comparison) == true ) { return; } // User explicitly requested for no HTML test result output processing if( NOM_TEST_FLAG(no_html_output) == true ) { return; } in = new JsonCppDeserializer(); if( fp.is_dir( VisualUnitTestResultWriter::ref_dir_ ) == false ) { NOM_LOG_ERR( NOM, "Reference directory path does not exist; did you forget to generate a reference image set?" ); return; } set1.set_directory( VisualUnitTestResultWriter::ref_dir_ ); set2.set_directory( VisualUnitTestResultWriter::output_dir_ ); if( set1.load_file( in ) == false || set2.load_file( in ) == false ) { return; } os = new HTMLTestResultWriter( set1, set2, VisualUnitTest::results_ ); // os = new MinimalTestResultWriter( set1, set2, VisualUnitTest::results_ ); // NOM_DUMP( os->output() ); std::string fp_ext = ".html"; // std::string fp_ext = ".txt"; std::string results_filename = "results_" + VisualUnitTest::timestamp() + fp_ext; std::string results_output = nom::test_output_directory + p.native() + test_info.name() + p.native() + results_filename; os->save_file( results_output ); }
virtual void OnTestCaseEnd(const ::testing::TestCase& test) { cout << "Tests run: " << test.total_test_count(); cout << ", Failures: " << test.failed_test_count(); cout << ", Skipped: " << test.disabled_test_count(); cout << ", Time elapsed: " << test.elapsed_time() / 1000.0 << " sec" << endl; }
virtual void OnTestCaseStart(const ::testing::TestCase& test) { cout << "Running test case: " << test.name() << endl; }
virtual void OnTestCaseEnd(const ::testing::TestCase& test_case) { printf("##teamcity[testSuiteFinished name='%s']\n", test_case.name()); }