test new mechanisms

This commit is contained in:
Julian Dolby 2014-01-07 22:36:23 -05:00
parent 98e631e1e2
commit b5627bbe81
1 changed files with 8 additions and 1 deletions

View File

@ -67,11 +67,18 @@ public class DynamicCallGraphTests extends WalaTestCase {
System.setProperty("dynamicCGFilter", tmpFile.getCanonicalPath());
}
try {
testMain.invoke(null, (Object)new String[0]);
testMain.invoke(null, (Object)new String[0]);
} catch (Throwable e) {
// exceptions allowed here, just collecting CG
}
// the VM is not exiting, so stop tracing explicitly
Class<?> runtimeClass = jcl.loadClass("com.ibm.wala.shrike.cg.Runtime");
Assert.assertNotNull(runtimeClass);
Method endTrace = runtimeClass.getDeclaredMethod("endTrace");
Assert.assertNotNull(endTrace);
endTrace.invoke(null);
Assert.assertTrue("expected to create call graph", new File(System.getProperty("dynamicCGFile")).exists());
}