コード例 #1
0
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 );
}
コード例 #2
0
ファイル: tests.cpp プロジェクト: cyrinux/eguan
 virtual void OnTestCaseStart(const ::testing::TestCase& test) {
     cout << "Running test case: " << test.name() << endl;
 }
コード例 #3
0
ファイル: all_tests.cpp プロジェクト: hellige/ccs-cpp
 virtual void OnTestCaseEnd(const ::testing::TestCase& test_case) {
   printf("##teamcity[testSuiteFinished name='%s']\n", test_case.name());
 }