public static void main(String[] args) { for (String arg : args) { TestCaseData tcase = TestCaseData.valueOf(arg); CompilerToVMHelper.writeDebugOutput(tcase.getData(), tcase.offset, tcase.length); CompilerToVMHelper.flushDebugOutput(); } }
private void test() { for (TestCaseData testCase : TestCaseData.values()) { System.out.println(testCase); OutputAnalyzer oa; try { oa = ProcessTools.executeTestJvmAllArgs( "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-Xbootclasspath/a:.", DebugOutputTest.Worker.class.getName(), testCase.name()); } catch (Throwable e) { e.printStackTrace(); throw new Error("Problems running child process", e); } if (testCase.expectedException != null) { oa.shouldHaveExitValue(1); oa.shouldContain(testCase.expectedException.getName()); } else { oa.shouldHaveExitValue(0); oa.shouldContain(new String(testCase.getExpected())); } } }
@Override public int compare(final Viewer viewer, final Object e1, final Object e2) { if (e1 instanceof TestCaseData && e2 instanceof TestCaseData) { final TestCaseData item1 = (TestCaseData) e1; final TestCaseData item2 = (TestCaseData) e2; return item2.getState().compareTo(item1.getState()); } return 0; }