changeset 5256:ced39ad6e1cf

7189944: (launcher) test/tools/launcher/Arrrrghs.java needs a couple of minor fixes Reviewed-by: darcy, jgish, jjh
author ksrini
date Thu, 16 Aug 2012 08:40:31 -0700
parents 6bd9089ebe96
children 92c7d1df9851
files test/tools/launcher/Arrrghs.java test/tools/launcher/TestHelper.java
diffstat 2 files changed, 6 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/launcher/Arrrghs.java	Thu Aug 16 08:29:30 2012 -0700
+++ b/test/tools/launcher/Arrrghs.java	Thu Aug 16 08:40:31 2012 -0700
@@ -24,7 +24,7 @@
 /**
  * @test
  * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938
- *      6894719 6968053 7151434
+ *      6894719 6968053 7151434 7146424
  * @summary Argument parsing validation.
  * @compile -XDignore.symbol.file Arrrghs.java
  * @run main Arrrghs
--- a/test/tools/launcher/TestHelper.java	Thu Aug 16 08:29:30 2012 -0700
+++ b/test/tools/launcher/TestHelper.java	Thu Aug 16 08:40:31 2012 -0700
@@ -189,13 +189,15 @@
                     m.invoke(this, (Object[]) null);
                     System.out.println(m.getName() + ": OK");
                     passed++;
+                    System.out.printf("Passed: %d, Failed: %d, ExitValue: %d%n",
+                                       passed, failed, testExitValue);
                 } catch (Throwable ex) {
                     System.out.printf("Test %s failed: %s %n", m, ex.getCause());
                     failed++;
                 }
             }
         }
-        System.out.printf("Passed: %d, Failed %d%n", passed, failed);
+        System.out.printf("Total: Passed: %d, Failed %d%n", passed, failed);
         if (failed > 0) {
             throw new RuntimeException("Tests failed: " + failed);
         }
@@ -456,6 +458,8 @@
         }
 
         void appendError(String x) {
+            testStatus = false;
+            testExitValue++;
             status.println(TEST_PREFIX + x);
         }
 
@@ -466,16 +470,12 @@
         void checkNegative() {
             if (exitValue == 0) {
                 appendError("test must not return 0 exit value");
-                testStatus = false;
-                testExitValue++;
             }
         }
 
         void checkPositive() {
             if (exitValue != 0) {
-                testStatus = false;
                 appendError("test did not return 0 exit value");
-                testExitValue++;
             }
         }
 
@@ -485,9 +485,7 @@
 
         boolean isZeroOutput() {
             if (!testOutput.isEmpty()) {
-                testStatus = false;
                 appendError("No message from cmd please");
-                testExitValue++;
                 return false;
             }
             return true;
@@ -495,9 +493,7 @@
 
         boolean isNotZeroOutput() {
             if (testOutput.isEmpty()) {
-                testStatus = false;
                 appendError("Missing message");
-                testExitValue++;
                 return false;
             }
             return true;
@@ -534,7 +530,6 @@
                 }
             }
             appendError("string <" + str + "> not found");
-            testExitValue++;
             return false;
         }
 
@@ -545,7 +540,6 @@
                 }
             }
             appendError("string <" + stringToMatch + "> not found");
-            testExitValue++;
             return false;
         }
     }