--- old/test/compiler/arguments/BMIUnsupportedCPUTest.java 2014-05-22 21:42:34.713367227 +0400 +++ new/test/compiler/arguments/BMIUnsupportedCPUTest.java 2014-05-22 21:42:34.589367231 +0400 @@ -28,6 +28,12 @@ * Test on bit manipulation related command line options, * that should be executed on CPU that does not support * required features. + * + * Note that this test intended to verify that VM could be launched with + * specific options and that values of these options processed correctly. + * In order to do that test launch a new VM with tested options, the same + * flavor-specific flag as one that was used for parent VM (-client, -server, + * -minimal, -graal) and '-version'. */ public class BMIUnsupportedCPUTest extends BMICommandLineOptionTestBase { @@ -64,28 +70,38 @@ */ public void unsupportedX86CPUTestCases() throws Throwable { - // verify that VM will succesfully start up, but output will - // contain a warning - CommandLineOptionTest. - verifyJVMStartup("-XX:+" + optionName, - new String[] { warningMessage }, - new String[] { errorMessage }, - ExitCode.OK); - - // verify that VM will succesfully startup without any warnings - CommandLineOptionTest. - verifyJVMStartup("-XX:-" + optionName, - null, - new String[] { warningMessage, errorMessage }, - ExitCode.OK); - - // verify that on unsupported CPUs option is off by default - CommandLineOptionTest.verifyOptionValue(optionName, "false"); - - // verify that on unsupported CPUs option will be off even if - // it was explicitly turned on by uset - CommandLineOptionTest.verifyOptionValue(optionName, "false", - "-XX:+" + optionName); + /* + Verify that VM will successfully start up, but output will contain a + warning. VM will be launched with following options: + -XX:+ -version + */ + CommandLineOptionTest.verifySameJVMStartup( + new String[] { warningMessage }, new String[] { errorMessage }, + ExitCode.OK, CommandLineOptionTest.prepareBooleanFlag( + optionName, true)); + + /* + Verify that VM will successfully startup without any warnings. + VM will be launched with following options: + -XX:- -version + */ + CommandLineOptionTest.verifySameJVMStartup(null, + new String[] { warningMessage, errorMessage }, ExitCode.OK, + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); + + /* + Verify that on unsupported CPUs option is off by default. + VM will be launched with following options: -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false"); + + /* + Verify that on unsupported CPUs option will be off even if + it was explicitly turned on by user. VM will be launched with + following options: -XX:+ -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); } @@ -97,18 +113,17 @@ */ public void unsupportedNonX86CPUTestCases() throws Throwable { - // verify that VM known nothing about tested option - CommandLineOptionTest. - verifyJVMStartup("-XX:+" + optionName, - new String[] { errorMessage }, - null, - ExitCode.FAIL); - - CommandLineOptionTest. - verifyJVMStartup("-XX:-" + optionName, - new String[] { errorMessage }, - null, - ExitCode.FAIL); + /* + Verify that VM known nothing about tested option. VM will be launched + with following options: -XX:[+-] -version + */ + CommandLineOptionTest.verifySameJVMStartup( + new String[] { errorMessage }, null, ExitCode.FAIL, + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); + + CommandLineOptionTest.verifySameJVMStartup( + new String[] { errorMessage }, null, ExitCode.FAIL, + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); } } --- old/test/compiler/arguments/BMISupportedCPUTest.java 2014-05-22 21:42:34.733367226 +0400 +++ new/test/compiler/arguments/BMISupportedCPUTest.java 2014-05-22 21:42:34.605367230 +0400 @@ -28,6 +28,12 @@ * Test on bit manipulation related command line options, * that should be executed on CPU that supports all required * features. + * + * Note that this test intended to verify that VM could be launched with + * specific options and that values of these options processed correctly. + * In order to do that test launch a new VM with tested options, the same + * flavor-specific flag as one that was used for parent VM (-client, -server, + * -minimal, -graal) and '-version'. */ public class BMISupportedCPUTest extends BMICommandLineOptionTestBase { @@ -49,24 +55,38 @@ @Override public void runTestCases() throws Throwable { - // verify that VM will succesfully start up whithout warnings - CommandLineOptionTest. - verifyJVMStartup("-XX:+" + optionName, - null, new String[] { warningMessage }, - ExitCode.OK); - - // verify that VM will succesfully start up whithout warnings - CommandLineOptionTest. - verifyJVMStartup("-XX:-" + optionName, - null, new String[] { warningMessage }, - ExitCode.OK); - - // verify that on appropriate CPU option in on by default - CommandLineOptionTest.verifyOptionValue(optionName, "true"); - - // verify that option could be explicitly turned off - CommandLineOptionTest.verifyOptionValue(optionName, "false", - "-XX:-" + optionName); + /* + Verify that VM will successfully start up without warnings. + VM will be launched with following flags: + -XX:+ -version + */ + CommandLineOptionTest.verifySameJVMStartup(null, + new String[] { warningMessage }, ExitCode.OK, + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); + + /* + Verify that VM will successfully start up without warnings. + VM will be launched with following flags: + -XX:- -version + */ + CommandLineOptionTest.verifySameJVMStartup(null, + new String[] { warningMessage }, ExitCode.OK, + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); + + /* + Verify that on appropriate CPU option in on by default. + VM will be launched with following flags: + -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true"); + + /* + Verify that option could be explicitly turned off. + VM will be launched with following flags: + -XX:- -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); } } --- old/test/compiler/arguments/BMICommandLineOptionTestBase.java 2014-05-22 21:42:34.741367226 +0400 +++ new/test/compiler/arguments/BMICommandLineOptionTestBase.java 2014-05-22 21:42:34.593367231 +0400 @@ -25,6 +25,12 @@ /** * Base class for all X86 bit manipulation related command line options. + * + * Note that this test intended to verify that VM could be launched with + * specific options and that values of these options processed correctly. + * In order to do that test launch a new VM with tested options, the same + * flavor-specific flag as one that was used for parent VM (-client, -server, + * -minimal, -graal) and '-version'. */ public abstract class BMICommandLineOptionTestBase extends CPUSpecificCommandLineOptionTest { @@ -58,10 +64,11 @@ String supportedCPUFeatures[], String unsupportedCPUFeatures[]) { super(".*", supportedCPUFeatures, unsupportedCPUFeatures); - this.optionName = optionName; - this.warningMessage = warningMessage; - this.errorMessage = CommandLineOptionTest. - UNRECOGNIZED_OPTION_ERROR_FORMAT.format(optionName); + this.optionName = optionName; + this.warningMessage = warningMessage; + this.errorMessage = String.format( + CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT, + optionName); } } --- old/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java 2014-05-22 21:42:34.745367226 +0400 +++ new/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java 2014-05-22 21:42:34.597367231 +0400 @@ -25,7 +25,7 @@ * @test * @bug 8031321 * @summary Verify processing of UseCountTrailingZerosInstruction option - * on CPU without TZCNT instuction (BMI1 feature) support. + * on CPU without TZCNT instruction (BMI1 feature) support. * @library /testlibrary /testlibrary/whitebox * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU * BMIUnsupportedCPUTest @@ -40,7 +40,8 @@ import com.oracle.java.testlibrary.cli.*; public class TestUseCountTrailingZerosInstructionOnUnsupportedCPU - extends BMIUnsupportedCPUTest { + extends BMIUnsupportedCPUTest { + private static final String ENABLE_BMI = "-XX:+UseBMI1Instructions"; public TestUseCountTrailingZerosInstructionOnUnsupportedCPU() { super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1"); @@ -51,16 +52,24 @@ super.unsupportedX86CPUTestCases(); - // verify that option will not be turned on during - // UseBMI1Instuctions processing - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "false", - "-XX:+UseBMI1Instructions"); - - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "false", - "-XX:+UseCountTrailingZerosInstruction", - "-XX:+UseBMI1Instructions"); + /* + Verify that option will not be turned on during UseBMI1Instructions + processing. VM will be launched with following options: + -XX:+UseBMI1Instructions -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + TestUseCountTrailingZerosInstructionOnUnsupportedCPU. + ENABLE_BMI); + + /* + VM will be launched with following options: + -XX:+UseCountTrailingZerosInstruction -XX:+UseBMI1Instructions + -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + CommandLineOptionTest.prepareBooleanFlag(optionName, true), + TestUseCountTrailingZerosInstructionOnUnsupportedCPU. + ENABLE_BMI); } public static void main(String args[]) throws Throwable { --- old/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java 2014-05-22 21:42:34.861367221 +0400 +++ new/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java 2014-05-22 21:42:34.745367226 +0400 @@ -40,7 +40,8 @@ import com.oracle.java.testlibrary.cli.*; public class TestUseCountTrailingZerosInstructionOnSupportedCPU - extends BMISupportedCPUTest { + extends BMISupportedCPUTest { + private static final String DISABLE_BMI = "-XX:-UseBMI1Instructions"; public TestUseCountTrailingZerosInstructionOnSupportedCPU() { super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1"); @@ -51,18 +52,23 @@ super.runTestCases(); - // verify that option will be disabled if all BMI1 instuctions - // are explicitly disabled - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "false", - "-XX:-UseBMI1Instructions"); - - // verify that option could be turned on even if other BMI1 - // instructions were turned off - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "true", - "-XX:-UseBMI1Instructions", - "-XX:+UseCountTrailingZerosInstruction"); + /* + Verify that option will be disabled if all BMI1 instructions + are explicitly disabled. VM will be launched with following options: + -XX:-UseBMI1Instructions -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI); + + /* + Verify that option could be turned on even if other BMI1 + instructions were turned off. VM will be launched with following + options: -XX:-UseBMI1Instructions + -XX:+UseCountTrailingZerosInstruction -version + */ + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true", + TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI, + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); } public static void main(String args[]) throws Throwable {