7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package compiler.testlibrary.rtm;
26
27 import java.io.IOException;
28 import java.nio.file.Files;
29 import java.nio.file.Paths;
30 import java.util.List;
31 import java.util.LinkedList;
32 import java.util.Arrays;
33 import java.util.Collections;
34 import java.util.regex.Matcher;
35 import java.util.regex.Pattern;
36
37 import jdk.test.lib.OutputAnalyzer;
38 import jdk.test.lib.ProcessTools;
39 import jdk.test.lib.Utils;
40 import jdk.test.lib.cli.CommandLineOptionTest;
41
42 /**
43 * Auxiliary methods used for RTM testing.
44 */
45 public class RTMTestBase {
46 private static final String RTM_STATE_CHANGE_REASON = "rtm_state_change";
47 /**
48 * We don't parse compilation log as XML-document and use regular
49 * expressions instead, because in some cases it could be
50 * malformed.
51 */
52 private static final String FIRED_UNCOMMON_TRAP_PATTERN_TEMPLATE
53 = "<uncommon_trap thread='[0-9]+' reason='%s'";
54 private static final String INSTALLED_UNCOMMON_TRAP_PATTERN_TEMPLATE
55 = "<uncommon_trap bci='[0-9]+' reason='%s'";
56
57 /**
58 * Executes RTM test in a new JVM started with {@code options} cli options.
59 *
60 * @param test test case to execute.
61 * @param options additional options for VM
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package compiler.testlibrary.rtm;
26
27 import jdk.test.lib.OutputAnalyzer;
28 import jdk.test.lib.ProcessTools;
29 import jdk.test.lib.Utils;
30 import jdk.test.lib.cli.CommandLineOptionTest;
31
32 import java.io.IOException;
33 import java.nio.file.Files;
34 import java.nio.file.Paths;
35 import java.util.Arrays;
36 import java.util.Collections;
37 import java.util.LinkedList;
38 import java.util.List;
39 import java.util.regex.Matcher;
40 import java.util.regex.Pattern;
41
42 /**
43 * Auxiliary methods used for RTM testing.
44 */
45 public class RTMTestBase {
46 private static final String RTM_STATE_CHANGE_REASON = "rtm_state_change";
47 /**
48 * We don't parse compilation log as XML-document and use regular
49 * expressions instead, because in some cases it could be
50 * malformed.
51 */
52 private static final String FIRED_UNCOMMON_TRAP_PATTERN_TEMPLATE
53 = "<uncommon_trap thread='[0-9]+' reason='%s'";
54 private static final String INSTALLED_UNCOMMON_TRAP_PATTERN_TEMPLATE
55 = "<uncommon_trap bci='[0-9]+' reason='%s'";
56
57 /**
58 * Executes RTM test in a new JVM started with {@code options} cli options.
59 *
60 * @param test test case to execute.
61 * @param options additional options for VM
|