From 8266e5a1df6686c22acbc8a890ac283a119c20c6 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Tue, 5 Jul 2011 07:19:10 +0000 Subject: [PATCH] Added -testall switch (does not exit on -test failure). git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@3203 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/prism/PrismCL.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/prism/src/prism/PrismCL.java b/prism/src/prism/PrismCL.java index 2ddc310b..f034f742 100644 --- a/prism/src/prism/PrismCL.java +++ b/prism/src/prism/PrismCL.java @@ -74,6 +74,7 @@ public class PrismCL private boolean explicitbuildtest = false; private boolean nobuild = false; private boolean test = false; + private boolean testExitsOnFail = true; // property info private int propertyToCheck = -1; @@ -437,7 +438,8 @@ public class PrismCL } } catch (PrismException e) { mainLog.println("Testing result: FAIL: " + e.getMessage()); - errorAndExit("Testing failed"); + if (testExitsOnFail) + errorAndExit("Testing failed"); } } @@ -1111,6 +1113,12 @@ public class PrismCL else if (sw.equals("test")) { test = true; } + // enable "test all" mode (don't stop on errors) + // (overrides -test switch) + else if (sw.equals("testall")) { + test = true; + testExitsOnFail = false; + } // IMPORT OPTIONS: @@ -1874,8 +1882,8 @@ public class PrismCL private void error(String s) { - // If (and only if) we are in "test" mode, treat any error as fatal - if (test) { + // If (and only if) we are in "test" (and not "testall") mode, treat any error as fatal + if (test && testExitsOnFail) { errorAndExit(s); } // Normal case: just display error message, but don't exit