diff options
| author | 2016-11-30 00:26:22 +0000 | |
|---|---|---|
| committer | 2016-11-30 00:26:22 +0000 | |
| commit | 10096becf60af4f0164db861d91e239177e1f47e (patch) | |
| tree | e623dafee5e746ca7a96928f127f0ae288be0ae7 | |
| parent | d7a7c7f3e93de9fa915e66d54dfc799efcc12ffb (diff) | |
| parent | 2194a6ffe9014a7ac969ed730eaea20c68de1a1f (diff) | |
Merge "Added support for android root in dexfuzz."
| -rw-r--r-- | tools/dexfuzz/src/dexfuzz/Options.java | 5 | ||||
| -rw-r--r-- | tools/dexfuzz/src/dexfuzz/executors/Executor.java | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tools/dexfuzz/src/dexfuzz/Options.java b/tools/dexfuzz/src/dexfuzz/Options.java index 7d5476da9a..99e03e8ea7 100644 --- a/tools/dexfuzz/src/dexfuzz/Options.java +++ b/tools/dexfuzz/src/dexfuzz/Options.java @@ -51,6 +51,7 @@ public class Options { public static boolean usingSpecificDevice = false; public static int repeat = 1; public static String executeDirectory = "/data/art-test"; + public static String androidRoot = ""; public static String dumpMutationsFile = "mutations.dump"; public static String loadMutationsFile = "mutations.dump"; public static String reportLogFile = "report.log"; @@ -95,6 +96,8 @@ public class Options { Log.always(" the argument given to adb -s. Default execution mode."); Log.always(" --execute-dir=<dir> : Push tests to this directory to execute them."); Log.always(" (Default: /data/art-test)"); + Log.always(" --android-root=<dir> : Set path where dalvikvm should look for binaries."); + Log.always(" Use this when pushing binaries to a custom location."); Log.always(" --no-boot-image : Use this flag when boot.art is not available."); Log.always(" --skip-host-verify : When executing, skip host-verification stage"); Log.always(" --execute-class=<c> : When executing, execute this class (default: Main)"); @@ -257,6 +260,8 @@ public class Options { usingSpecificDevice = true; } else if (key.equals("execute-dir")) { executeDirectory = value; + } else if (key.equals("android-root")) { + androidRoot = value; } else { Log.error("Unrecognised key: --" + key); usage(); diff --git a/tools/dexfuzz/src/dexfuzz/executors/Executor.java b/tools/dexfuzz/src/dexfuzz/executors/Executor.java index c62a3ad322..2bcf3a1a77 100644 --- a/tools/dexfuzz/src/dexfuzz/executors/Executor.java +++ b/tools/dexfuzz/src/dexfuzz/executors/Executor.java @@ -177,7 +177,15 @@ public abstract class Executor { * Executes runtime. */ public void execute(String programName) { - executionResult = executeCommandWithTimeout(constructCommand(programName), true); + String command = ""; + String androidRoot = Options.androidRoot.trim(); + if (androidRoot.length() != 0) { + command = "PATH=" + androidRoot + "/bin "; + command += "ANDROID_ROOT=" + androidRoot + " "; + command += "LD_LIBRARY_PATH="+ androidRoot + "/lib:" + androidRoot + "/lib64 "; + } + command += constructCommand(programName); + executionResult = executeCommandWithTimeout(command, true); } /** |