test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java
Print this page
@@ -119,11 +119,13 @@
* Runs test cases on non-X86 CPU.
* @throws Throwable
*/
protected void runNonX86TestCases() throws Throwable {
CommandLineOptionTest.verifySameJVMStartup(
- new String[] { errorMessage }, null, ExitCode.FAIL,
+ new String[] { errorMessage }, null,
+ String.format("Option '%s' should be unknown on non-X86CPUs.%n"
+ + "JVM startup should fail", optionName), "", ExitCode.FAIL,
prepareOptionValue(defaultValue));
}
/**
* Runs generic X86 test cases.
@@ -134,57 +136,77 @@
verifyOptionValues();
}
protected void verifyJVMStartup() throws Throwable {
String optionValue = prepareOptionValue(defaultValue);
+ String shouldFailMessage = String.format("VM option '%s' is "
+ + "experimental.%nVM startup expected to fail without "
+ + "-XX:+UnlockExperimentalVMOptions option", optionName);
+ String shouldPassMessage = String.format("VM option '%s' is "
+ + "experimental%nVM startup should pass with "
+ + "-XX:+UnlockExperimentalVMOptions option", optionName);
if (isExperimental) {
// verify that option is experimental
CommandLineOptionTest.verifySameJVMStartup(
new String[] { experimentalOptionError },
- new String[] { errorMessage }, ExitCode.FAIL,
- optionValue);
+ new String[] { errorMessage }, shouldFailMessage,
+ shouldFailMessage, ExitCode.FAIL, optionValue);
// verify that it could be passed if experimental options
// are unlocked
CommandLineOptionTest.verifySameJVMStartup(null,
new String[] {
experimentalOptionError,
errorMessage
},
+ shouldPassMessage,
+ "JVM should start without any warnings or errors",
ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
optionValue);
} else {
// verify that option could be passed
CommandLineOptionTest.verifySameJVMStartup(null,
- new String[]{errorMessage}, ExitCode.OK, optionValue);
+ new String[]{errorMessage},
+ String.format("VM startup shuld pass with '%s' option",
+ optionName),
+ "JVM should start without any warnings or errors",
+ ExitCode.OK, optionValue);
}
}
protected void verifyOptionValues() throws Throwable {
// verify default value
if (isExperimental) {
CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
defaultValue,
+ String.format("Option '%s' is expected to have '%s' "
+ + "default value", optionName, defaultValue),
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
} else {
CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
- defaultValue);
+ defaultValue,
+ String.format("Option '%s' is expected to have '%s' "
+ + "default value", optionName, defaultValue));
}
// verify other specified option values
if (optionValues == null) {
return;
}
for (String value : optionValues) {
if (isExperimental) {
CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
value,
+ String.format("Option '%s' is set to have '%s' value",
+ optionName, value),
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
prepareOptionValue(value));
} else {
CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
- value, prepareOptionValue(value));
+ value,
+ String.format("Option '%s' is set to have '%s' value",
+ optionName, value), prepareOptionValue(value));
}
}
}
protected String prepareOptionValue(String value) {