Mercurial > hg > truffle
annotate test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java @ 18604:39441c10d314
try to be more precise about python executable name
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 03 Dec 2014 22:10:15 +0100 |
parents | 100f2b109432 |
children |
rev | line source |
---|---|
17872
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
1 /* |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
4 * |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
8 * |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
13 * accompanied this code). |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
14 * |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
18 * |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
21 * questions. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
22 * |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
23 */ |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
24 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
25 import com.oracle.java.testlibrary.*; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
26 import com.oracle.java.testlibrary.cli.*; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
27 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
28 import java.util.function.BooleanSupplier; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
29 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
30 /** |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
31 * Base for all RTM-related CLI tests. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
32 */ |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
33 public abstract class RTMGenericCommandLineOptionTest |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
34 extends CommandLineOptionTest { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
35 protected static final String RTM_INSTR_ERROR |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
36 = "RTM instructions are not available on this CPU"; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
37 protected static final String RTM_UNSUPPORTED_VM_ERROR |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
38 = "RTM locking optimization is not supported in this VM"; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
39 protected static final String RTM_ABORT_RATIO_WARNING |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
40 = "RTMAbortRatio must be in the range 0 to 100, resetting it to 50"; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
41 protected static final String RTM_FOR_STACK_LOCKS_WARNING |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
42 = "UseRTMForStackLocks flag should be off when UseRTMLocking " |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
43 + "flag is off"; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
44 protected static final String RTM_COUNT_INCR_WARNING |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
45 = "RTMTotalCountIncrRate must be a power of 2, resetting it to 64"; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
46 protected static final String RTM_BIASED_LOCKING_WARNING |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
47 = "Biased locking is not supported with RTM locking; " |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
48 + "ignoring UseBiasedLocking flag"; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
49 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
50 protected final String optionName; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
51 protected final String errorMessage; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
52 protected final String experimentalOptionError; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
53 protected final boolean isExperimental; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
54 protected final boolean isBoolean; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
55 protected final String defaultValue; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
56 protected final String[] optionValues; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
57 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
58 /** |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
59 * Constructs new genetic RTM CLI test, for option {@code optionName} which |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
60 * has default value {@code defaultValue}. Test cases will use option's |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
61 * values passed via {@code optionValues} for verification of correct |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
62 * option processing. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
63 * |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
64 * Test constructed using this ctor will be started on any cpu regardless |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
65 * it's architecture and supported/unsupported features. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
66 * |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
67 * @param predicate predicate responsible for test's preconditions check |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
68 * @param optionName name of option to be tested |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
69 * @param isBoolean {@code true} if option is binary |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
70 * @param isExperimental {@code true} if option is experimental |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
71 * @param defaultValue default value of tested option |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
72 * @param optionValues different option values |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
73 */ |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
74 public RTMGenericCommandLineOptionTest(BooleanSupplier predicate, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
75 String optionName, boolean isBoolean, boolean isExperimental, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
76 String defaultValue, String... optionValues) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
77 super(predicate); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
78 this.optionName = optionName; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
79 this.isExperimental = isExperimental; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
80 this.isBoolean = isBoolean; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
81 this.defaultValue = defaultValue; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
82 this.optionValues = optionValues; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
83 this.errorMessage = CommandLineOptionTest. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
84 getUnrecognizedOptionErrorMessage(optionName); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
85 this.experimentalOptionError = CommandLineOptionTest. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
86 getExperimentalOptionErrorMessage(optionName); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
87 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
88 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
89 @Override |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
90 public void runTestCases() throws Throwable { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
91 if (Platform.isX86() || Platform.isX64()) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
92 if (Platform.isServer() && !Platform.isEmbedded()) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
93 runX86SupportedVMTestCases(); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
94 } else { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
95 runX86UnsupportedVMTestCases(); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
96 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
97 } else { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
98 runNonX86TestCases(); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
99 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
100 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
101 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
102 /** |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
103 * Runs test cases on X86 CPU if VM supports RTM locking. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
104 * @throws Throwable |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
105 */ |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
106 protected void runX86SupportedVMTestCases() throws Throwable { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
107 runGenericX86TestCases(); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
108 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
109 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
110 /** |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
111 * Runs test cases on non-X86 CPU if VM does not support RTM locking. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
112 * @throws Throwable |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
113 */ |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
114 protected void runX86UnsupportedVMTestCases() throws Throwable { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
115 runGenericX86TestCases(); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
116 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
117 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
118 /** |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
119 * Runs test cases on non-X86 CPU. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
120 * @throws Throwable |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
121 */ |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
122 protected void runNonX86TestCases() throws Throwable { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
123 CommandLineOptionTest.verifySameJVMStartup( |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
124 new String[] { errorMessage }, null, ExitCode.FAIL, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
125 prepareOptionValue(defaultValue)); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
126 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
127 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
128 /** |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
129 * Runs generic X86 test cases. |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
130 * @throws Throwable |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
131 */ |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
132 protected void runGenericX86TestCases() throws Throwable { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
133 verifyJVMStartup(); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
134 verifyOptionValues(); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
135 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
136 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
137 protected void verifyJVMStartup() throws Throwable { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
138 String optionValue = prepareOptionValue(defaultValue); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
139 if (isExperimental) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
140 // verify that option is experimental |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
141 CommandLineOptionTest.verifySameJVMStartup( |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
142 new String[] { experimentalOptionError }, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
143 new String[] { errorMessage }, ExitCode.FAIL, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
144 optionValue); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
145 // verify that it could be passed if experimental options |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
146 // are unlocked |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
147 CommandLineOptionTest.verifySameJVMStartup(null, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
148 new String[] { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
149 experimentalOptionError, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
150 errorMessage |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
151 }, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
152 ExitCode.OK, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
153 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
154 optionValue); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
155 } else { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
156 // verify that option could be passed |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
157 CommandLineOptionTest.verifySameJVMStartup(null, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
158 new String[]{errorMessage}, ExitCode.OK, optionValue); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
159 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
160 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
161 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
162 protected void verifyOptionValues() throws Throwable { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
163 // verify default value |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
164 if (isExperimental) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
165 CommandLineOptionTest.verifyOptionValueForSameVM(optionName, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
166 defaultValue, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
167 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
168 } else { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
169 CommandLineOptionTest.verifyOptionValueForSameVM(optionName, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
170 defaultValue); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
171 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
172 // verify other specified option values |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
173 if (optionValues == null) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
174 return; |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
175 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
176 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
177 for (String value : optionValues) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
178 if (isExperimental) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
179 CommandLineOptionTest.verifyOptionValueForSameVM(optionName, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
180 value, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
181 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
182 prepareOptionValue(value)); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
183 } else { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
184 CommandLineOptionTest.verifyOptionValueForSameVM(optionName, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
185 value, prepareOptionValue(value)); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
186 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
187 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
188 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
189 |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
190 protected String prepareOptionValue(String value) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
191 if (isBoolean) { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
192 return CommandLineOptionTest.prepareBooleanFlag(optionName, |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
193 Boolean.valueOf(value)); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
194 } else { |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
195 return String.format("-XX:%s=%s", optionName, value); |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
196 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
197 } |
100f2b109432
8039496: Add sanity tests on RTM-related command line options
iignatyev
parents:
diff
changeset
|
198 } |