8196750: [Testbug] tools/launcher tests need to tolerate unrelated warnings
Reviewed-by: ksrini, dholmes
This commit is contained in:
parent
98cd47840a
commit
5cd79594c5
@ -52,27 +52,33 @@ public class InfoStreams {
|
|||||||
|
|
||||||
String classPath = System.getProperty("java.class.path");
|
String classPath = System.getProperty("java.class.path");
|
||||||
|
|
||||||
run("-help").stderrShouldMatch(USAGE).stdoutShouldNotMatch(".");
|
run("-help").stderrShouldMatch(USAGE).stdoutShouldNotMatch(USAGE);
|
||||||
run("--help").stdoutShouldMatch(USAGE).stderrShouldNotMatch(".");
|
run("--help").stdoutShouldMatch(USAGE).stderrShouldNotMatch(USAGE);
|
||||||
|
|
||||||
run("-version").stderrShouldMatch(VERSION_ERR).stdoutShouldNotMatch(".");
|
run("-version").stderrShouldMatch(VERSION_ERR)
|
||||||
run("--version").stdoutShouldMatch(VERSION_OUT).stderrShouldNotMatch(".");
|
.stdoutShouldNotMatch(VERSION_ERR)
|
||||||
|
.stdoutShouldNotMatch(VERSION_OUT);
|
||||||
|
run("--version").stdoutShouldMatch(VERSION_OUT)
|
||||||
|
.stderrShouldNotMatch(VERSION_OUT)
|
||||||
|
.stderrShouldNotMatch(VERSION_ERR);
|
||||||
|
|
||||||
run("-showversion", "--dry-run", "-cp", classPath, "InfoStreams")
|
run("-showversion", "--dry-run", "-cp", classPath, "InfoStreams")
|
||||||
.stderrShouldMatch(VERSION_ERR)
|
.stderrShouldMatch(VERSION_ERR)
|
||||||
.stdoutShouldNotMatch(".");
|
.stdoutShouldNotMatch(VERSION_ERR)
|
||||||
|
.stdoutShouldNotMatch(VERSION_OUT);
|
||||||
run("--show-version", "--dry-run", "-cp", classPath, "InfoStreams")
|
run("--show-version", "--dry-run", "-cp", classPath, "InfoStreams")
|
||||||
.stdoutShouldMatch(VERSION_OUT)
|
.stdoutShouldMatch(VERSION_OUT)
|
||||||
.stderrShouldNotMatch(".");
|
.stderrShouldNotMatch(VERSION_OUT)
|
||||||
|
.stderrShouldNotMatch(VERSION_ERR);
|
||||||
|
|
||||||
run("-fullversion").stderrShouldMatch(FULLVERSION_ERR)
|
run("-fullversion").stderrShouldMatch(FULLVERSION_ERR)
|
||||||
.stdoutShouldNotMatch(".");
|
.stdoutShouldNotMatch(FULLVERSION_ERR)
|
||||||
|
.stdoutShouldNotMatch(FULLVERSION_OUT);
|
||||||
run("--full-version").stdoutShouldMatch(FULLVERSION_OUT)
|
run("--full-version").stdoutShouldMatch(FULLVERSION_OUT)
|
||||||
.stderrShouldNotMatch(".");
|
.stderrShouldNotMatch(FULLVERSION_OUT)
|
||||||
|
.stderrShouldNotMatch(FULLVERSION_ERR);
|
||||||
run("-X").stderrShouldMatch(NONSTD).stdoutShouldNotMatch(".");
|
|
||||||
run("--help-extra").stdoutShouldMatch(NONSTD).stderrShouldNotMatch(".");
|
|
||||||
|
|
||||||
|
run("-X").stderrShouldMatch(NONSTD).stdoutShouldNotMatch(NONSTD);
|
||||||
|
run("--help-extra").stdoutShouldMatch(NONSTD).stderrShouldNotMatch(NONSTD);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,6 @@ public class ToolsOpts extends TestHelper {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] output = tr.testOutput.toArray(new String[tr.testOutput.size()]);
|
|
||||||
//-Joptions should not be passed to tool
|
//-Joptions should not be passed to tool
|
||||||
if (jpos > -1) {
|
if (jpos > -1) {
|
||||||
checkJoptionOutput(tr, arg);
|
checkJoptionOutput(tr, arg);
|
||||||
@ -194,14 +193,23 @@ public class ToolsOpts extends TestHelper {
|
|||||||
+ "CMD: " + cmdString);
|
+ "CMD: " + cmdString);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//check that each non -J option was passed to tool.
|
// check that each non -J option was passed to tool. It looks for each arg in the output.
|
||||||
|
// Irrelevant lines in the output are skipped. Arguments order is checked as well.
|
||||||
|
int j = 0;
|
||||||
|
List<String> output = tr.testOutput;
|
||||||
for (int i = 0; i < arg.length; i++) {
|
for (int i = 0; i < arg.length; i++) {
|
||||||
if (output[i].compareTo(arg[i]) != 0) {
|
boolean found = false;
|
||||||
|
for (; j < output.size(); j++) {
|
||||||
|
if (output.get(j).equals(arg[i])) {
|
||||||
|
pass("check " + output.get(j) + " == " + arg[i]);
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"failed! CMD: " + cmdString + "\n case:" +
|
"failed! Should have passed non -J option [" + arg[i] + "] to tool.\n"
|
||||||
output[i] + " != " + arg[i]);
|
+ "CMD: " + cmdString);
|
||||||
} else {
|
|
||||||
pass("check " + output[i] + " == " + arg[i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user