mobile tests changes

This commit is contained in:
Julian Dolby 2015-04-07 19:34:27 -04:00
parent 80df82caca
commit b7cf88e214
2 changed files with 11 additions and 6 deletions

View File

@ -10,7 +10,8 @@
*******************************************************************************/
package com.ibm.wala.core.tests.util;
import org.junit.After;import org.junit.Assert;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.runner.JUnitCore;

View File

@ -111,7 +111,7 @@ public abstract class DroidBenchCGTest extends DalvikCallGraphTestBase {
private final File androidJavaJar;
private final String apkFile;
public final String apkFile;
private final Set<MethodReference> uncalled;
@ -122,16 +122,20 @@ public abstract class DroidBenchCGTest extends DalvikCallGraphTestBase {
this.uncalled = uncalled;
}
@Test
public void test() throws IOException, ClassHierarchyException, CancelException, InvalidClassFileException, IllegalArgumentException, URISyntaxException {
@Test
public void runTest() throws IOException, ClassHierarchyException, CancelException, InvalidClassFileException, IllegalArgumentException, URISyntaxException {
System.err.println("testing " + apkFile + "...");
Pair<CallGraph,PointerAnalysis<InstanceKey>> x = makeAPKCallGraph(androidLibs, androidJavaJar, apkFile, new NullProgressMonitor(), ReflectionOptions.ONE_FLOW_TO_CASTS_APPLICATION_GET_METHOD);
//System.err.println(x.fst);
Set<IMethod> bad = assertUserCodeReachable(x.fst, uncalled);
Assert.assertTrue(bad + " should be empty", bad.isEmpty());
assertion(bad + " should be empty", bad.isEmpty());
System.err.println("...success testing " + apkFile);
}
protected void assertion(String string, boolean empty) {
Assert.assertTrue(string, empty);
}
private static final Set<String> skipTests = HashSetFactory.make();
static {
// serialization issues