Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-04 05:18:24

0001 /**
0002  * This file defines the executable that will run the tests.
0003  *
0004  * Author: M. De Mattia demattia@.pd.infn.it
0005  *
0006  * class description:
0007  *
0008  *
0009  */
0010 
0011 #include <cppunit/TestFixture.h>
0012 #include <cppunit/extensions/HelperMacros.h>
0013 #include <cppunit/TestResult.h>
0014 #include <cppunit/TestCaller.h>
0015 #include <cppunit/TestRunner.h>
0016 #include <cppunit/ui/text/TestRunner.h>
0017 #include <cppunit/TestResultCollector.h>
0018 #include <cppunit/TextTestProgressListener.h>
0019 #include <cppunit/CompilerOutputter.h>
0020 #include <cppunit/extensions/TestFactoryRegistry.h>
0021 #include <cppunit/CompilerOutputter.h>
0022 // #include <cppunit/TextTestProgressListener.h>
0023 #include <cppunit/BriefTestProgressListener.h>
0024 
0025 /**
0026  * Main function used to run all tests.
0027  * We are not using the one in #include <Utilities/Testing/interface/CppUnit_testdriver.icpp>
0028  * because we use the BriefTestProgressListener to output the name of each test.
0029  */
0030 
0031 int main(int argc, char* argv[]) {
0032   std::string testPath = (argc > 1) ? std::string(argv[1]) : "";
0033   CppUnit::TextUi::TestRunner runner;
0034   CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
0035   runner.addTest(registry.makeTest());
0036 
0037   // Outputs the name of each test when it is executed.
0038   CppUnit::BriefTestProgressListener progress;
0039   runner.eventManager().addListener(&progress);
0040   runner.run();
0041 }