Salome HOME
custom test runner to run only a subset of complete test suite
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_Main.cxx
index 66fcdafc3fee9f735325afc6ae630f190ed154f7..52b58728a34c1f218c55d6692405c5aba63f4e35 100644 (file)
 #include <cppunit/CompilerOutputter.h>
 #include <cppunit/TestResult.h>
 #include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
 #include <cppunit/TextTestProgressListener.h>
 #include <stdexcept>
 #include <TestViewer.h>
+#include <TestLib_Runner.h>
 #include <OCCViewer_ViewWindow.h>
 #include <SUIT_Session.h>
 #include <QApplication>
 #include <QColor>
-
-std::ostream& operator<<( std::ostream& theStream, const QString& theText )
-{
-  theStream << theText.toStdString();
-  return theStream;
-}
-
-std::ostream& operator<<( std::ostream& theStream, const QColor& theColor )
-{
-  theStream << "[" << theColor.red() << ", " << theColor.green() << ", " << theColor.blue() << "]";
-  return theStream;
-}
 #include <time.h>
 
 int main( int argc, char* argv[] )
@@ -69,12 +57,14 @@ int main( int argc, char* argv[] )
   CppUnit::TestFactoryRegistry& registry = 
     CppUnit::TestFactoryRegistry::getRegistry();
   // Add the top suite to the test runner
-  CppUnit::TestRunner runner;
+  TestLib_Runner runner;
+  QString aPath = qgetenv( "HYDRO_SRC_DIR" ) + "/src/tests.cfg";
+  runner.Load( aPath.toStdString() );
   runner.addTest( registry.makeTest() );   
   try
   {
     std::cout << "Running "  <<  testPath;
-    runner.run( controller, testPath );
+    runner.Run( controller );
 
     std::cerr << std::endl;