소스 검색

Improved the handling of failing plugin tests.

Sascha Zelzer 14 년 전
부모
커밋
4a44811275
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      Libs/PluginFramework/Testing/Cpp/ctkPluginFrameworkTestRunner.cpp

+ 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: