cucumber tests: invoke System.exit even if exception is thrown to avoid hanging
authornik <Nikolay.Chashnikov@jetbrains.com>
Thu, 20 Aug 2015 14:18:22 +0000 (17:18 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Thu, 20 Aug 2015 14:18:42 +0000 (17:18 +0300)
build/cucumber-test-runner/src/com/intellij/cucumber/CucumberMain.java

index 04aa4bad456fc504c7fba610788481342e0024af..40d91c7dfe0c22d1c724f3384abc9e216352718a 100644 (file)
@@ -38,7 +38,13 @@ public class CucumberMain {
   }
 
   public static void main(String[] args) throws IOException {
-    int exitStatus = run(args, Thread.currentThread().getContextClassLoader());
+    int exitStatus;
+    try {
+      exitStatus = run(args, Thread.currentThread().getContextClassLoader());
+    }
+    catch (Throwable e) {
+      exitStatus = 1;
+    }
     System.exit(exitStatus);
 
   }