提交 79ce44f1 编写于 作者: K ksrini

7189944: (launcher) test/tools/launcher/Arrrrghs.java needs a couple of minor fixes

Reviewed-by: darcy, jgish
上级 3dd6a453
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
/** /**
* @test * @test
* @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938 * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938
* 6894719 6968053 7151434 * 6894719 6968053 7151434 7146424
* @summary Argument parsing validation. * @summary Argument parsing validation.
* @compile -XDignore.symbol.file Arrrghs.java * @compile -XDignore.symbol.file Arrrghs.java
* @run main Arrrghs * @run main Arrrghs
......
...@@ -189,13 +189,15 @@ public class TestHelper { ...@@ -189,13 +189,15 @@ public class TestHelper {
m.invoke(this, (Object[]) null); m.invoke(this, (Object[]) null);
System.out.println(m.getName() + ": OK"); System.out.println(m.getName() + ": OK");
passed++; passed++;
System.out.printf("Passed: %d, Failed: %d, ExitValue: %d%n",
passed, failed, testExitValue);
} catch (Throwable ex) { } catch (Throwable ex) {
System.out.printf("Test %s failed: %s %n", m, ex.getCause()); System.out.printf("Test %s failed: %s %n", m, ex.getCause());
failed++; 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) { if (failed > 0) {
throw new RuntimeException("Tests failed: " + failed); throw new RuntimeException("Tests failed: " + failed);
} }
...@@ -456,6 +458,8 @@ public class TestHelper { ...@@ -456,6 +458,8 @@ public class TestHelper {
} }
void appendError(String x) { void appendError(String x) {
testStatus = false;
testExitValue++;
status.println(TEST_PREFIX + x); status.println(TEST_PREFIX + x);
} }
...@@ -466,16 +470,12 @@ public class TestHelper { ...@@ -466,16 +470,12 @@ public class TestHelper {
void checkNegative() { void checkNegative() {
if (exitValue == 0) { if (exitValue == 0) {
appendError("test must not return 0 exit value"); appendError("test must not return 0 exit value");
testStatus = false;
testExitValue++;
} }
} }
void checkPositive() { void checkPositive() {
if (exitValue != 0) { if (exitValue != 0) {
testStatus = false;
appendError("test did not return 0 exit value"); appendError("test did not return 0 exit value");
testExitValue++;
} }
} }
...@@ -485,9 +485,7 @@ public class TestHelper { ...@@ -485,9 +485,7 @@ public class TestHelper {
boolean isZeroOutput() { boolean isZeroOutput() {
if (!testOutput.isEmpty()) { if (!testOutput.isEmpty()) {
testStatus = false;
appendError("No message from cmd please"); appendError("No message from cmd please");
testExitValue++;
return false; return false;
} }
return true; return true;
...@@ -495,9 +493,7 @@ public class TestHelper { ...@@ -495,9 +493,7 @@ public class TestHelper {
boolean isNotZeroOutput() { boolean isNotZeroOutput() {
if (testOutput.isEmpty()) { if (testOutput.isEmpty()) {
testStatus = false;
appendError("Missing message"); appendError("Missing message");
testExitValue++;
return false; return false;
} }
return true; return true;
...@@ -534,7 +530,6 @@ public class TestHelper { ...@@ -534,7 +530,6 @@ public class TestHelper {
} }
} }
appendError("string <" + str + "> not found"); appendError("string <" + str + "> not found");
testExitValue++;
return false; return false;
} }
...@@ -545,7 +540,6 @@ public class TestHelper { ...@@ -545,7 +540,6 @@ public class TestHelper {
} }
} }
appendError("string <" + stringToMatch + "> not found"); appendError("string <" + stringToMatch + "> not found");
testExitValue++;
return false; return false;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册