[Cppunit-devel] TestLogger
Brought to you by:
blep
From: Hauber, R. Dr., V. <rud...@lf...> - 2002-02-28 09:49:18
|
Hi folks, first of all thank you very much for your effort. We have developed a simple logging facility for logging test results. The class TestLogger is attached. It is very simple to use - see the example below. The background: We use CppUnit for automated class and comonent testing generated from Rational Rose models in now 4 greater projects. It works very very good! A script uses a class test template (based on the CppUnit classes) and generates the specialized class test code for selected classes in the model. Corrsponding MS VC++ projects are generated too. The class tests are added to Rational TestManager. In this way we can start regression test very simple: A batch file starts the make file and then the executible. The logs are stored by TestLogger. ---------------------------------------------------------------------------- ---------- TestLogger logger("<test_name>"); TextTestResult *result = new TextTestResult; TestSuite *suite = MyClassTest::suite (); logger.logTestCases(suite); suite->run(result); if (result->wasSuccessful()) { std::cout << "test successfully passed" << std::endl; success = 0; } else { std::cout << "test not successful, see log file " << logger.getLogFileName() << std::endl; success = - ( result->testErrors() + result->testFailures() ); } // write the dump to the dump file logger.logTestResult(result); ---------------------------------------------------------------------------- ---------- <<TestUtil.h>> <<TestUtil.cpp>> Regards Rudi ________________________________________________________________ Dr. Rudolf Hauber mailto:RH...@ka... Koelsch & Altmann GmbH fax: +49-89-651071-91 Perlacher Str. 21 voice: +49-89-651071-25 D-81539 Muenchen mobile: +49-172-8945-297 Germany http://www.ka-muc.de |