changeset 13416:9732a77088fe

7189944: (launcher) test/tools/launcher/Arrrrghs.java needs a couple of minor fixes Reviewed-by: darcy, jgish
author ksrini
date Wed, 08 Aug 2012 09:29:32 -0700
parents 0430f69eed3b
children 0da65e793d21
files jdk/test/tools/launcher/Arrrghs.java jdk/test/tools/launcher/TestHelper.java
diffstat 2 files changed, 6 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/tools/launcher/Arrrghs.java	Wed Aug 08 15:31:22 2012 +0100
+++ b/jdk/test/tools/launcher/Arrrghs.java	Wed Aug 08 09:29:32 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/jdk/test/tools/launcher/TestHelper.java	Wed Aug 08 15:31:22 2012 +0100
+++ b/jdk/test/tools/launcher/TestHelper.java	Wed Aug 08 09:29:32 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;
         }
     }