1 /* 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 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 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 com.oracle.java.testlibrary.OutputAnalyzer; 38 import com.oracle.java.testlibrary.ProcessTools; 39 import com.oracle.java.testlibrary.Utils; 40 import com.oracle.java.testlibrary.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. | 1 /* 2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 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 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. |