170 if (annos.length != 0 && 171 (list == null || list.contains(m.getName()))) { 172 tests.put(getClass().getSimpleName() + "::" + m.getName(), m); 173 } 174 } 175 } 176 177 protected void run(String[] args, Class<?>... classes) throws Throwable { 178 if (args.length == 0) { 179 // Spawn a new VM instance 180 execute_vm(); 181 } else { 182 // Execute tests 183 run(classes); 184 } 185 } 186 187 private void execute_vm() throws Throwable { 188 Asserts.assertFalse(tests.isEmpty(), "no tests to execute"); 189 ArrayList<String> args = new ArrayList<String>(defaultFlags); 190 if (VERIFY_VM) { 191 args.addAll(verifyFlags); 192 } 193 // Run tests in own process and verify output 194 args.add(getClass().getName()); 195 args.add("run"); 196 // Spawn process with default JVM options from the test's run command 197 String[] vmInputArgs = InputArguments.getVmInputArgs(); 198 String[] cmds = Arrays.copyOf(vmInputArgs, vmInputArgs.length + args.size()); 199 System.arraycopy(args.toArray(), 0, cmds, vmInputArgs.length, args.size()); 200 OutputAnalyzer oa = ProcessTools.executeTestJvm(cmds); 201 // If ideal graph printing is enabled/supported, verify output 202 String output = oa.getOutput(); 203 oa.shouldHaveExitValue(0); 204 if (VERIFY_IR) { 205 if (output.contains("PrintIdeal enabled") && !output.contains("ValueTypePassFieldsAsArgs is not supported on this platform")) { 206 parseOutput(output); 207 } else { 208 System.out.println(output); 209 System.out.println("WARNING: IR verification failed! Running with -Xint, -Xcomp or release build?"); | 170 if (annos.length != 0 && 171 (list == null || list.contains(m.getName()))) { 172 tests.put(getClass().getSimpleName() + "::" + m.getName(), m); 173 } 174 } 175 } 176 177 protected void run(String[] args, Class<?>... classes) throws Throwable { 178 if (args.length == 0) { 179 // Spawn a new VM instance 180 execute_vm(); 181 } else { 182 // Execute tests 183 run(classes); 184 } 185 } 186 187 private void execute_vm() throws Throwable { 188 Asserts.assertFalse(tests.isEmpty(), "no tests to execute"); 189 ArrayList<String> args = new ArrayList<String>(defaultFlags); 190 if (VERIFY_IR) { 191 // Always trap for exception throwing to not confuse IR verification 192 args.add("-XX:-OmitStackTraceInFastThrow"); 193 } 194 if (VERIFY_VM) { 195 args.addAll(verifyFlags); 196 } 197 // Run tests in own process and verify output 198 args.add(getClass().getName()); 199 args.add("run"); 200 // Spawn process with default JVM options from the test's run command 201 String[] vmInputArgs = InputArguments.getVmInputArgs(); 202 String[] cmds = Arrays.copyOf(vmInputArgs, vmInputArgs.length + args.size()); 203 System.arraycopy(args.toArray(), 0, cmds, vmInputArgs.length, args.size()); 204 OutputAnalyzer oa = ProcessTools.executeTestJvm(cmds); 205 // If ideal graph printing is enabled/supported, verify output 206 String output = oa.getOutput(); 207 oa.shouldHaveExitValue(0); 208 if (VERIFY_IR) { 209 if (output.contains("PrintIdeal enabled") && !output.contains("ValueTypePassFieldsAsArgs is not supported on this platform")) { 210 parseOutput(output); 211 } else { 212 System.out.println(output); 213 System.out.println("WARNING: IR verification failed! Running with -Xint, -Xcomp or release build?"); |