diff options
author | Calin Juravle <calin@google.com> | 2015-04-07 12:31:39 +0100 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2015-04-07 17:02:36 +0100 |
commit | 733840f23a6983436437d4334f33d5032f494696 (patch) | |
tree | 9076ff001735c4aaa653c6202b0c1c12a838281f /tools | |
parent | f9492310913a09f7c63ca2c8cc948b731adf150a (diff) | |
download | art-733840f23a6983436437d4334f33d5032f494696.zip art-733840f23a6983436437d4334f33d5032f494696.tar.gz art-733840f23a6983436437d4334f33d5032f494696.tar.bz2 |
Remove fuzzer build-time dependency on core image.
Test if the image exists at runtime.
Forcing this dependency slows down development. For example, if after a
change dex2oat does not compile anymore you need to first revert to a
stable state and rebuild the core image to be able to move foreward.
Since this is a test tool, it is ok to assume that the core image has
already been built if host execution was selected.
Change-Id: Id61a960ba62bb8d1d21acb07114f72208fbc9720
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dexfuzz/Android.mk | 5 | ||||
-rw-r--r-- | tools/dexfuzz/src/dexfuzz/executors/Device.java | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/tools/dexfuzz/Android.mk b/tools/dexfuzz/Android.mk index 1e4b4f5..1580bc3 100644 --- a/tools/dexfuzz/Android.mk +++ b/tools/dexfuzz/Android.mk @@ -31,7 +31,10 @@ LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := EXECUTABLES LOCAL_MODULE := dexfuzz include $(BUILD_SYSTEM)/base_rules.mk -$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/dexfuzz $(ACP) $(HOST_CORE_IMG_OUTS) +$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/dexfuzz $(ACP) @echo "Copy: $(PRIVATE_MODULE) ($@)" $(copy-file-to-new-target) $(hide) chmod 755 $@ + +# --- dexfuzz script with core image dependencies ---------------- +fuzzer: $(LOCAL_BUILT_MODULE) $(HOST_CORE_IMG_OUTS) diff --git a/tools/dexfuzz/src/dexfuzz/executors/Device.java b/tools/dexfuzz/src/dexfuzz/executors/Device.java index 736aaad..4a53957 100644 --- a/tools/dexfuzz/src/dexfuzz/executors/Device.java +++ b/tools/dexfuzz/src/dexfuzz/executors/Device.java @@ -17,6 +17,7 @@ package dexfuzz.executors; import java.io.IOException; +import java.io.File; import java.util.Map; import dexfuzz.ExecutionResult; @@ -67,6 +68,10 @@ public class Device { return envVars.get(key); } + private String getHostCoreImagePath() { + return androidHostOut + "/framework/core.art"; + } + private void setup() { programPushed = false; @@ -74,6 +79,13 @@ public class Device { androidProductOut = checkForEnvVar(envVars, "ANDROID_PRODUCT_OUT"); androidHostOut = checkForEnvVar(envVars, "ANDROID_HOST_OUT"); + if (Options.executeOnHost) { + File coreImage = new File(getHostCoreImagePath()); + if (!coreImage.exists()) { + Log.errorAndQuit("Host core image not found at " + coreImage.getPath() + + ". Did you forget to build it?"); + } + } if (!isHost) { // Create temporary consumers for the initial test. StreamConsumer outputConsumer = new StreamConsumer(); @@ -144,7 +156,7 @@ public class Device { * Get any extra flags required to execute ART on the host. */ public String getHostExecutionFlags() { - return String.format("-Xnorelocate -Ximage:%s/framework/core.art", androidHostOut); + return String.format("-Xnorelocate -Ximage:%s", getHostCoreImagePath()); } public String getAndroidHostOut() { |