com.oracle.java.testlibrary.cli.CommandLineOptionTest Java Examples

The following examples show how to use com.oracle.java.testlibrary.cli.CommandLineOptionTest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestUseRTMDeopt.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void verifyUseRTMDeopt(boolean useRTMDeopt) throws Throwable {
    AbortProvoker provoker = AbortType.XABORT.provoker();
    String logFileName = String.format("rtm_%s_deopt.xml",
            useRTMDeopt ? "use" : "no");

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            logFileName,
            provoker,
            CommandLineOptionTest.prepareBooleanFlag("UseRTMDeopt",
                    useRTMDeopt),
            AbortProvoker.class.getName(),
            AbortType.XABORT.toString()
    );

    outputAnalyzer.shouldHaveExitValue(0);

    int expectedUncommonTraps = useRTMDeopt ? 1 : 0;
    int installedUncommonTraps
            = RTMTestBase.installedRTMStateChangeTraps(logFileName);

    Asserts.assertEQ(expectedUncommonTraps, installedUncommonTraps,
            String.format("Expected to find %d uncommon traps "
                          + "installed with reason rtm_state_change.",
                    expectedUncommonTraps));
}
 
Example #2
Source File: TestUseRTMDeopt.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void verifyUseRTMDeopt(boolean useRTMDeopt) throws Throwable {
    AbortProvoker provoker = AbortType.XABORT.provoker();
    String logFileName = String.format("rtm_%s_deopt.xml",
            useRTMDeopt ? "use" : "no");

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            logFileName,
            provoker,
            CommandLineOptionTest.prepareBooleanFlag("UseRTMDeopt",
                    useRTMDeopt),
            AbortProvoker.class.getName(),
            AbortType.XABORT.toString()
    );

    outputAnalyzer.shouldHaveExitValue(0);

    int expectedUncommonTraps = useRTMDeopt ? 1 : 0;
    int installedUncommonTraps
            = RTMTestBase.installedRTMStateChangeTraps(logFileName);

    Asserts.assertEQ(expectedUncommonTraps, installedUncommonTraps,
            String.format("Expected to find %d uncommon traps "
                          + "installed with reason rtm_state_change.",
                    expectedUncommonTraps));
}
 
Example #3
Source File: GenericTestCaseForSupportedSparcCPU.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that on supported CPU option is enabled by default.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true");

    // Verify that it is possible to explicitly enable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that it is possible to explicitly disable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // verify that option is disabled when -UseSHA was passed to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false));

    // Verify that it is possible to explicitly disable the tested option
    // even if +UseSHA was passed to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example #4
Source File: GenericTestCaseForSupportedSparcCPU.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there are no warning when option is explicitly enabled.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option could be disabled even if +UseSHA was passed to
    // JVM.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // Verify that it is possible to enable the tested option and disable
    // all SHA intrinsics via -UseSHA without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example #5
Source File: GenericTestCaseForUnsupportedX86CPU.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that when the tested option is explicitly enabled, then
    // a warning will occur in VM output.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option could be explicitly disabled without
    // a warning.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example #6
Source File: GenericTestCaseForSupportedSparcCPU.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there are no warning when option is explicitly enabled.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option could be disabled even if +UseSHA was passed to
    // JVM.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // Verify that it is possible to enable the tested option and disable
    // all SHA intrinsics via -UseSHA without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example #7
Source File: GenericTestCaseForUnsupportedX86CPU.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that when the tested option is explicitly enabled, then
    // a warning will occur in VM output.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option could be explicitly disabled without
    // a warning.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example #8
Source File: GenericTestCaseForSupportedSparcCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there are no warning when option is explicitly enabled.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option could be disabled even if +UseSHA was passed to
    // JVM.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // Verify that it is possible to enable the tested option and disable
    // all SHA intrinsics via -UseSHA without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example #9
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that UseSHA option remains disabled even if all
    // UseSHA*Intrincs options were enabled.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));

    // Verify that UseSHA option remains disabled even if all
    // UseSHA*Intrincs options were enabled and UseSHA was enabled as well.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));
}
 
Example #10
Source File: TestUseRTMDeopt.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void verifyUseRTMDeopt(boolean useRTMDeopt) throws Throwable {
    AbortProvoker provoker = AbortType.XABORT.provoker();
    String logFileName = String.format("rtm_%s_deopt.xml",
            useRTMDeopt ? "use" : "no");

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            logFileName,
            provoker,
            CommandLineOptionTest.prepareBooleanFlag("UseRTMDeopt",
                    useRTMDeopt),
            AbortProvoker.class.getName(),
            AbortType.XABORT.toString()
    );

    outputAnalyzer.shouldHaveExitValue(0);

    int expectedUncommonTraps = useRTMDeopt ? 1 : 0;
    int installedUncommonTraps
            = RTMTestBase.installedRTMStateChangeTraps(logFileName);

    Asserts.assertEQ(expectedUncommonTraps, installedUncommonTraps,
            String.format("Expected to find %d uncommon traps "
                          + "installed with reason rtm_state_change.",
                    expectedUncommonTraps));
}
 
Example #11
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that UseSHA option remains disabled even if all
    // UseSHA*Intrincs options were enabled.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));

    // Verify that UseSHA option remains disabled even if all
    // UseSHA*Intrincs options were enabled and UseSHA was enabled as well.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));
}
 
Example #12
Source File: GenericTestCaseForSupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there are no warning when option is explicitly enabled.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option could be disabled even if +UseSHA was passed to
    // JVM.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // Verify that it is possible to enable the tested option and disable
    // all SHA intrinsics via -UseSHA without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example #13
Source File: GenericTestCaseForSupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that on supported CPU option is enabled by default.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true");

    // Verify that it is possible to explicitly enable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that it is possible to explicitly disable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // verify that option is disabled when -UseSHA was passed to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false));

    // Verify that it is possible to explicitly disable the tested option
    // even if +UseSHA was passed to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example #14
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that UseSHA option remains disabled even if all
    // UseSHA*Intrincs options were enabled.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));

    // Verify that UseSHA option remains disabled even if all
    // UseSHA*Intrincs options were enabled and UseSHA was enabled as well.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));
}
 
Example #15
Source File: GenericTestCaseForSupportedSparcCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that on supported CPU option is enabled by default.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true");

    // Verify that it is possible to explicitly enable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that it is possible to explicitly disable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // verify that option is disabled when -UseSHA was passed to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false));

    // Verify that it is possible to explicitly disable the tested option
    // even if +UseSHA was passed to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example #16
Source File: GenericTestCaseForSupportedSparcCPU.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there are no warning when option is explicitly enabled.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option could be disabled even if +UseSHA was passed to
    // JVM.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // Verify that it is possible to enable the tested option and disable
    // all SHA intrinsics via -UseSHA without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example #17
Source File: GenericTestCaseForUnsupportedX86CPU.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that when the tested option is explicitly enabled, then
    // a warning will occur in VM output.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option could be explicitly disabled without
    // a warning.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example #18
Source File: GenericTestCaseForUnsupportedX86CPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that the tested option is disabled by default.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");

    // Verify that it is not possible to explicitly enable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option is disabled even if +UseSHA was passed
    // to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true));
}
 
Example #19
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that attempt to enable the tested option will cause a warning.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example #20
Source File: TestUseRTMXendForLockBusy.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void verifyXendForLockBusy(boolean inflateMonitor,
        boolean useXend) throws Throwable {
    CompilableTest test = new BusyLock();

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            test,
            CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
                    inflateMonitor),
            CommandLineOptionTest.prepareBooleanFlag(
                    "UseRTMXendForLockBusy",
                    useXend),
            "-XX:RTMRetryCount=0",
            "-XX:RTMTotalCountIncrRate=1",
            "-XX:+PrintPreciseRTMLockingStatistics",
            BusyLock.class.getName(),
            Boolean.toString(inflateMonitor),
            Integer.toString(TestUseRTMXendForLockBusy.LOCKING_TIME)
    );

    outputAnalyzer.shouldHaveExitValue(0);

    List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
            test.getMethodWithLockName(), outputAnalyzer.getOutput());

    Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
            + "exactly one rtm locking statistics entry for method "
            + test.getMethodWithLockName());

    long aborts = statistics.get(0).getAborts(AbortType.XABORT);

    if (useXend) {
        Asserts.assertEQ(aborts, 0L,
                "Expected to get no aborts on busy lock");
    } else {
        Asserts.assertGT(aborts, 0L,
                "Expected to get at least one abort on busy lock");
    }
}
 
Example #21
Source File: GenericTestCaseForUnsupportedX86CPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that the tested option is disabled by default.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");

    // Verify that it is not possible to explicitly enable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option is disabled even if +UseSHA was passed
    // to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true));
}
 
Example #22
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that UseSHA is disabled when all UseSHA*Intrinscs are
    // disabled.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));

    CommandLineOptionTest.verifyOptionValueForSameVM(
            // Verify that UseSHA is disabled when all UseSHA*Intrinscs are
            // disabled even if it was explicitly enabled.
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));

    // Verify that explicitly disabled UseSHA option remains disabled even
    // if all UseSHA*Intrinsics options were enabled.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));
}
 
Example #23
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that attempt to use UseSHA option will cause a warning.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example #24
Source File: TestRTMTotalCountIncrRate.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void verifyLocksCount(int incrRate, boolean useStackLock)
        throws Throwable{
    CompilableTest test = new Test();

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            test,
            CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
                    useStackLock),
            CommandLineOptionTest.prepareNumericFlag(
                    "RTMTotalCountIncrRate", incrRate),
            "-XX:RTMRetryCount=0",
            "-XX:+PrintPreciseRTMLockingStatistics",
            Test.class.getName(),
            Boolean.toString(!useStackLock)
    );

    outputAnalyzer.shouldHaveExitValue(0);

    List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
            test.getMethodWithLockName(), outputAnalyzer.getOutput());

    Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
            + "exactly one RTM locking statistics entry for method "
            + test.getMethodWithLockName());

    RTMLockingStatistics lock = statistics.get(0);
    if (incrRate == 1) {
        Asserts.assertEQ(lock.getTotalLocks(), Test.TOTAL_ITERATIONS,
                "Total locks should be exactly the same as amount of "
                + "iterations.");
    } else {
        Asserts.assertGT(lock.getTotalLocks(), 0L, "RTM statistics "
                + "should contain information for at least on lock.");
    }
}
 
Example #25
Source File: TestUseRTMXendForLockBusy.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void verifyXendForLockBusy(boolean inflateMonitor,
        boolean useXend) throws Throwable {
    CompilableTest test = new BusyLock();

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            test,
            CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
                    inflateMonitor),
            CommandLineOptionTest.prepareBooleanFlag(
                    "UseRTMXendForLockBusy",
                    useXend),
            "-XX:RTMRetryCount=0",
            "-XX:RTMTotalCountIncrRate=1",
            "-XX:+PrintPreciseRTMLockingStatistics",
            BusyLock.class.getName(),
            Boolean.toString(inflateMonitor),
            Integer.toString(TestUseRTMXendForLockBusy.LOCKING_TIME)
    );

    outputAnalyzer.shouldHaveExitValue(0);

    List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
            test.getMethodWithLockName(), outputAnalyzer.getOutput());

    Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
            + "exactly one rtm locking statistics entry for method "
            + test.getMethodWithLockName());

    long aborts = statistics.get(0).getAborts(AbortType.XABORT);

    if (useXend) {
        Asserts.assertEQ(aborts, 0L,
                "Expected to get no aborts on busy lock");
    } else {
        Asserts.assertGT(aborts, 0L,
                "Expected to get at least one abort on busy lock");
    }
}
 
Example #26
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that UseSHA is disabled when all UseSHA*Intrinscs are
    // disabled.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));

    CommandLineOptionTest.verifyOptionValueForSameVM(
            // Verify that UseSHA is disabled when all UseSHA*Intrinscs are
            // disabled even if it was explicitly enabled.
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));

    // Verify that explicitly disabled UseSHA option remains disabled even
    // if all UseSHA*Intrinsics options were enabled.
    CommandLineOptionTest.verifyOptionValueForSameVM(
            SHAOptionsBase.USE_SHA_OPTION, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));
}
 
Example #27
Source File: TestRTMAbortThreshold.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void verifyAbortThreshold(boolean useStackLock,
        long abortThreshold) throws Throwable {
    AbortProvoker provoker = AbortType.XABORT.provoker();

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            provoker,
            "-XX:+UseRTMDeopt",
            "-XX:RTMAbortRatio=0",
            CommandLineOptionTest.prepareNumericFlag("RTMAbortThreshold",
                    abortThreshold),
            CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
                    useStackLock),
            "-XX:RTMTotalCountIncrRate=1",
            "-XX:+PrintPreciseRTMLockingStatistics",
            AbortProvoker.class.getName(),
            AbortType.XABORT.toString(),
            Boolean.toString(!useStackLock));

    outputAnalyzer.shouldHaveExitValue(0);

    List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
            provoker.getMethodWithLockName(), outputAnalyzer.getOutput());

    Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
            + "exactly one RTM locking statistics entry for method "
            + provoker.getMethodWithLockName());

    Asserts.assertEQ(statistics.get(0).getTotalLocks(), abortThreshold,
            String.format("Expected that method with rtm lock elision was"
                    + " deoptimized after %d lock attempts",
                    abortThreshold));
}
 
Example #28
Source File: GenericTestCaseForUnsupportedX86CPU.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that the tested option is disabled by default.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");

    // Verify that it is not possible to explicitly enable the option.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option is disabled even if +UseSHA was passed
    // to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true));
}
 
Example #29
Source File: TestRTMSpinLoopCount.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private long getAbortsCountOnLockBusy(int spinLoopCount) throws Throwable {
    CompilableTest test = new BusyLock();

    OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
            test,
            CommandLineOptionTest.prepareNumericFlag("RTMRetryCount",
                    TestRTMSpinLoopCount.RTM_RETRY_COUNT),
            CommandLineOptionTest.prepareNumericFlag("RTMSpinLoopCount",
                    spinLoopCount),
            "-XX:-UseRTMXendForLockBusy",
            "-XX:RTMTotalCountIncrRate=1",
            "-XX:+PrintPreciseRTMLockingStatistics",
            BusyLock.class.getName(),
            Boolean.toString(TestRTMSpinLoopCount.INFLATE_MONITOR),
            Integer.toString(TestRTMSpinLoopCount.LOCKING_TIME)
    );

    outputAnalyzer.shouldHaveExitValue(0);

    List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
            test.getMethodWithLockName(), outputAnalyzer.getOutput());

    Asserts.assertEQ(statistics.size(), 1,
            "VM output should contain exactly one entry for method "
             + test.getMethodWithLockName());

    RTMLockingStatistics lock = statistics.get(0);

    Asserts.assertLTE(lock.getTotalAborts(),
            TestRTMSpinLoopCount.MAX_ABORTS, String.format("Total aborts "
                    + "count (%d) should be less or equal to %d",
                    lock.getTotalAborts(),
                    TestRTMSpinLoopCount.MAX_ABORTS));

    return lock.getTotalAborts();
}
 
Example #30
Source File: GenericTestCaseForUnsupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyOptionValues() throws Throwable {
    // Verify that option is disabled by default.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");

    // Verify that option is disabled even if it was explicitly enabled
    // using CLI options.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option is disabled when +UseSHA was passed to JVM.
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true));
}