Changes in src/unittests/logunittest.cpp [a67d19:952f38]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/logunittest.cpp
ra67d19 r952f38 11 11 12 12 #include "logunittest.hpp" 13 #include " log.hpp"13 #include "Helpers/Log.hpp" 14 14 #include "defs.hpp" 15 #include "verbose.hpp" 15 #include "Helpers/Verbose.hpp" 16 17 #ifdef HAVE_TESTRUNNER 18 #include "UnitTestMain.hpp" 19 #endif /*HAVE_TESTRUNNER*/ 16 20 17 21 /********************************************** Test classes **************************************/ … … 27 31 void LogTest::tearDown() 28 32 { 33 logger::purgeInstance(); 34 errorLogger::purgeInstance(); 29 35 }; 30 36 … … 34 40 void LogTest::logTest() 35 41 { 36 logger::getInstance() ->setVerbosity(2);42 logger::getInstance().setVerbosity(2); 37 43 DoLog(0) && (Log() << Verbose(0) << "Verbosity level is set to 2." << endl); 38 44 DoLog(0) && (Log() << Verbose(0) << "Test level 0" << endl); … … 48 54 DoeLog(4) && (eLog()<< Verbose(4) << "This should not be printed." << endl); 49 55 }; 50 51 52 /********************************************** Main routine **************************************/53 54 int main(int argc, char **argv)55 {56 // Get the top level suite from the registry57 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();58 59 // Adds the test to the list of test to run60 CppUnit::TextUi::TestRunner runner;61 runner.addTest( suite );62 63 // Change the default outputter to a compiler error format outputter64 runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),65 std::cerr ) );66 // Run the tests.67 bool wasSucessful = runner.run();68 69 // Return error code 1 if the one of test failed.70 return wasSucessful ? 0 : 1;71 };
Note:
See TracChangeset
for help on using the changeset viewer.