7189944: (launcher) test/tools/launcher/Arrrrghs.java needs a couple of minor fixes
Reviewed-by: darcy, jgish
diff --git a/test/tools/launcher/Arrrghs.java b/test/tools/launcher/Arrrghs.java
index 342be0e..364589f 100644
--- a/test/tools/launcher/Arrrghs.java
+++ b/test/tools/launcher/Arrrghs.java
@@ -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
diff --git a/test/tools/launcher/TestHelper.java b/test/tools/launcher/TestHelper.java
index c799a13..893b90f 100644
--- a/test/tools/launcher/TestHelper.java
+++ b/test/tools/launcher/TestHelper.java
@@ -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;
}
}