瀏覽代碼

Quit PluginFramework tests on test failure.

Sascha Zelzer 14 年之前
父節點
當前提交
797c95b41d
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      Libs/PluginFramework/Testing/Cpp/ctkPluginFrameworkTestMain.cpp

+ 5 - 2
Libs/PluginFramework/Testing/Cpp/ctkPluginFrameworkTestMain.cpp

@@ -51,11 +51,14 @@ public:
 
     QList<ctkServiceReference> refs = context->getServiceReferences<ctkTestSuiteInterface>();
 
+    int result = 0;
     foreach(ctkServiceReference ref, refs)
     {
-      int result = QTest::qExec(context->getService(ref), argc, argv);
-      if (result > 0) QCoreApplication::exit(result);
+      result += QTest::qExec(context->getService(ref), argc, argv);
+      if (result > 0) break;
     }
+
+    if (result > 0) QCoreApplication::exit(result);
   }
 
 private: