summaryrefslogtreecommitdiffstats
path: root/test/118-noimage-dex2oat
diff options
context:
space:
mode:
authorJean Christophe Beyler <jean.christophe.beyler@intel.com>2014-09-12 12:03:25 -0700
committerAndreas Gampe <agampe@google.com>2015-02-23 15:43:46 -0800
commit24e04aa68c575d349eac0d9d09aab9bd3106ef94 (patch)
treee6a14642cc4a4b409fe98a696b17968c6d0a65f4 /test/118-noimage-dex2oat
parent38fee8ef4bc0f4dbe2c6d1f5585895f0c4d16984 (diff)
downloadart-24e04aa68c575d349eac0d9d09aab9bd3106ef94.zip
art-24e04aa68c575d349eac0d9d09aab9bd3106ef94.tar.gz
art-24e04aa68c575d349eac0d9d09aab9bd3106ef94.tar.bz2
ART: Allow the execution to stop if the compilation fails via an option
The current implementation continues the execution of the application if dex2oat fails by relying on the interpreter. This patch adds a -Xno-dex-file-fallback option to stop the default behavior. This can be used two-fold. First, one can enforce that a runtime only starts with a boot image. A follow-up patch will ensure that dex2oat (for apps) and patchoat in general request that mode and close gracefully otherwise. Second, this can be used for testing and debugging purposes, as it ensures that compiler failures & aborts are not silently ignored. Add testing. Bug: 19100590 Change-Id: Iaf07b5ccf00942ca8a8ec8687599320a3ddbc089 Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
Diffstat (limited to 'test/118-noimage-dex2oat')
-rw-r--r--test/118-noimage-dex2oat/expected.txt2
-rw-r--r--test/118-noimage-dex2oat/run6
2 files changed, 7 insertions, 1 deletions
diff --git a/test/118-noimage-dex2oat/expected.txt b/test/118-noimage-dex2oat/expected.txt
index bcb695d..0103e89 100644
--- a/test/118-noimage-dex2oat/expected.txt
+++ b/test/118-noimage-dex2oat/expected.txt
@@ -1,6 +1,8 @@
Run -Xnoimage-dex2oat
Has image is false, is image dex2oat enabled is false, is BOOTCLASSPATH on disk is false.
testB18485243 PASS
+Run -Xnoimage-dex2oat -Xno-dex-file-fallback
+Failed to initialize runtime (check log for details)
Run -Ximage-dex2oat
Has image is true, is image dex2oat enabled is true, is BOOTCLASSPATH on disk is true.
testB18485243 PASS
diff --git a/test/118-noimage-dex2oat/run b/test/118-noimage-dex2oat/run
index 2037797..4b1d0ce 100644
--- a/test/118-noimage-dex2oat/run
+++ b/test/118-noimage-dex2oat/run
@@ -46,10 +46,14 @@ bpath="${bpath}:${framework}/bouncycastle${bpath_suffix}.jar"
bpath_arg="--runtime-option -Xbootclasspath:${bpath}"
-# Make sure we can run without an oat file,
+# Make sure we can run without an oat file.
echo "Run -Xnoimage-dex2oat"
${RUN} ${flags} ${bpath_arg} --runtime-option -Xnoimage-dex2oat --runtime-option -Xnodex2oat
+# Make sure we cannot run without an oat file without fallback.
+echo "Run -Xnoimage-dex2oat -Xno-dex-file-fallback"
+${RUN} ${flags} ${bpath_arg} --runtime-option -Xnoimage-dex2oat --runtime-option -Xnodex2oat --runtime-option -Xno-dex-file-fallback
+
# Make sure we can run with the oat file.
echo "Run -Ximage-dex2oat"
${RUN} ${flags} ${bpath_arg} --runtime-option -Ximage-dex2oat