Forráskód Böngészése

Improved the handling of failing plugin tests.

Sascha Zelzer 14 éve
szülő
commit
4a44811275

+ 9 - 2
Libs/PluginFramework/Testing/Cpp/ctkPluginFrameworkTestRunner.cpp

@@ -67,13 +67,20 @@ public:
     QList<ctkServiceReference> refs = context->getServiceReferences<ctkTestSuiteInterface>();
 
     int result = 0;
+    int count = 0;
     foreach(ctkServiceReference ref, refs)
     {
-      result += QTest::qExec(context->getService(ref), argc, argv);
+      result = QTest::qExec(context->getService(ref), argc, argv);
       if (result > 0) break;
+      ++count;
     }
 
-    if (result > 0) QCoreApplication::exit(result);
+    qDebug() << "#########" << count << "out of" << refs.size() << "test suites passed #########";
+    if (result > 0)
+    {
+      QCoreApplication::exit(result);
+      qApp->thread()->wait();
+    }
   }
 
 private: