@Test public void testStringPrims() throws IOException, IllegalArgumentException, CancelException, WalaException { SSAPropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "string-prims.js"); B.getOptions().setTraceStringConstants(true); CallGraph CG = B.makeCallGraph(B.getOptions()); // JSCallGraphUtil.AVOID_DUMP = false; CAstCallGraphUtil.dumpCG(B.getCFAContextInterpreter(), B.getPointerAnalysis(), CG); verifyGraphAssertions(CG, assertionsForStringPrims); }
public static CallGraph makeHTMLCG(URL url, Supplier<JSSourceExtractor> fExtractor) throws IllegalArgumentException, CancelException, WalaException { SSAPropagationCallGraphBuilder b = makeHTMLCGBuilder(url, fExtractor); CallGraph CG = b.makeCallGraph(b.getOptions()); dumpCG(b.getCFAContextInterpreter(), b.getPointerAnalysis(), CG); return CG; }
@Test(expected = CallGraphBuilderCancelException.class) public void testManyStrings() throws IllegalArgumentException, IOException, CancelException, WalaException { SSAPropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "many-strings.js"); B.getOptions().setTraceStringConstants(true); ProgressMaster monitor = ProgressMaster.make(new NullProgressMonitor(), 10000, false); monitor.beginTask("build CG", 1); CallGraph CG = B.makeCallGraph(B.getOptions(), monitor); monitor.done(); CAstCallGraphUtil.dumpCG(B.getCFAContextInterpreter(), B.getPointerAnalysis(), CG); }
cg = cgb.makeCallGraph(cgb.getOptions()); } catch (Exception e) { graphBuilt = false;
@Test public void testTutorialExample() throws IllegalArgumentException, IOException, CancelException, WalaException { SSAPropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "tutorial-example.js"); CallGraph CG = B.makeCallGraph(B.getOptions()); CAstCallGraphUtil.dumpCG(B.getCFAContextInterpreter(), B.getPointerAnalysis(), CG); // verifyGraphAssertions(CG, assertionsForDateProperty); }
@Test public void testReturnThis() throws IOException, IllegalArgumentException, CancelException, WalaException { SSAPropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "return_this.js"); CallGraph CG = B.makeCallGraph(B.getOptions()); // JSCallGraphUtil.AVOID_DUMP = false; CAstCallGraphUtil.dumpCG(B.getCFAContextInterpreter(), B.getPointerAnalysis(), CG); verifyGraphAssertions(CG, assertionsForReturnThis); }
@Test public void testDispatch() throws IOException, IllegalArgumentException, CancelException, WalaException { SSAPropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "dispatch.js"); CallGraph CG = B.makeCallGraph(B.getOptions()); // JSCallGraphUtil.AVOID_DUMP = false; CAstCallGraphUtil.dumpCG(B.getCFAContextInterpreter(), B.getPointerAnalysis(), CG); verifyGraphAssertions(CG, assertionsForDispatch); }
@Ignore("need to fix this. bug from Sukyoung's group") @Test public void testLoops() throws IllegalArgumentException, IOException, CancelException, WalaException { SSAPropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "loops.js"); CallGraph CG = B.makeCallGraph(B.getOptions()); boolean x = CAstCallGraphUtil.AVOID_DUMP; CAstCallGraphUtil.AVOID_DUMP = false; CAstCallGraphUtil.dumpCG(B.getCFAContextInterpreter(), B.getPointerAnalysis(), CG); CAstCallGraphUtil.AVOID_DUMP = x; verifyGraphAssertions(CG, assertionsForLoops); }
@Ignore("need to fix this. bug from Sukyoung's group") @Test public void testPrimitiveStrings() throws IllegalArgumentException, IOException, CancelException, WalaException { SSAPropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "primitive_strings.js"); CallGraph CG = B.makeCallGraph(B.getOptions()); boolean x = CAstCallGraphUtil.AVOID_DUMP; CAstCallGraphUtil.AVOID_DUMP = false; CAstCallGraphUtil.dumpCG(B.getCFAContextInterpreter(), B.getPointerAnalysis(), CG); CAstCallGraphUtil.AVOID_DUMP = x; verifyGraphAssertions(CG, assertionsForPrimitiveStrings); }
if (!getBuilder().getOptions().getHandleStaticInit()) { return;
if (!getBuilder().getOptions().getHandleStaticInit()) { return;