@Before public void setupProfiler() throws IOException { engine.getInstruments().get(TruffleProfiler.ID).setEnabled(true); TruffleProfiler.setTestHook( new TestHook() { public void onCreate(TruffleProfiler p) { profiler = p; } }); assertEvalOut("", ""); // ensure profiler gets loaded Assert.assertNotNull(profiler); }
@After public void clearTestHook() { // clear up otherwise test execution of others get affected TruffleProfiler.setTestHook(null); }