Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
/**
 * This file defines the executable that will run the tests.
 *
 * Author: M. De Mattia demattia@.pd.infn.it
 *
 * class description:
 *
 *
 */

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestCaller.h>
#include <cppunit/TestRunner.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TextTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/CompilerOutputter.h>
// #include <cppunit/TextTestProgressListener.h>
#include <cppunit/BriefTestProgressListener.h>

/**
 * Main function used to run all tests.
 * We are not using the one in #include <Utilities/Testing/interface/CppUnit_testdriver.icpp>
 * because we use the BriefTestProgressListener to output the name of each test.
 */

int main(int argc, char* argv[]) {
  std::string testPath = (argc > 1) ? std::string(argv[1]) : "";
  CppUnit::TextUi::TestRunner runner;
  CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
  runner.addTest(registry.makeTest());

  // Outputs the name of each test when it is executed.
  CppUnit::BriefTestProgressListener progress;
  runner.eventManager().addListener(&progress);
  runner.run();
}