camino-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Camino-devel] camino/src main-unittest.cpp


From: Philippe Fremy
Subject: [Camino-devel] camino/src main-unittest.cpp
Date: Tue, 28 Jan 2003 16:52:46 -0500

CVSROOT:        /cvsroot/camino
Module name:    camino
Changes by:     Philippe Fremy <address@hidden> 03/01/28 16:52:46

Modified files:
        src            : main-unittest.cpp 

Log message:
        move to a more qt based main for unitests

Patches:
Index: camino/src/main-unittest.cpp
diff -u camino/src/main-unittest.cpp:1.5 camino/src/main-unittest.cpp:1.6
--- camino/src/main-unittest.cpp:1.5    Sun Jan 26 16:55:54 2003
+++ camino/src/main-unittest.cpp        Tue Jan 28 16:52:46 2003
@@ -1,6 +1,7 @@
 
 #include <qapplication.h>
 #include <qwidget.h>
+#include <qlabel.h>
 
 #include <iostream>
 
@@ -8,29 +9,40 @@
 
 #include "common/PhilTestRunner.h"
 
+
 //! Use a text runner and fetch automatically the existing test suites
-int automaticTextRun()
+int runTests()
 {
        PhilTestRunner runner;  
 
-       /*
-       // add tests manually
-       runner.addTest( TestMyClass::suite() );
-       runner.addTest( TestFoo::suite() );
-       */
-
        // fetch all existing test suites automatically
        runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() 
);
 
        return runner.run();
 }
 
-int main()
+class RunTests : public QLabel
 {
-       int success = 0;
-       success = automaticTextRun();
+public:
+       RunTests() : QLabel( "Tests running!", 0L) {
+               runTests();
+       }
+};
+
+
+
+int main( int argc, char ** argv)
+{
+
+       QApplication a( argc, argv );
+
+       
+       RunTests testWidget;
+       a.setMainWidget( &testWidget );
+
+       a.exec();
 
        getchar();
-       return success;
+       return 0;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]