summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2018-02-22 17:49:36 +0000
committer Roland Levillain <rpl@google.com> 2018-02-22 18:43:12 +0000
commitc3394e03ace5eb85d06f02b4ba3d22de88b6dae8 (patch)
tree9e7a1d14ee6a161821c5de227b70e9f8039e0d33
parentb2f1edc3d1f162bd9007f10bc66009eac5b2daab (diff)
Fix exit status of `run` scripts executing more than one test.
For some ART run-tests, the `run` script executes more than one instance of the test (e.g. test/004-ThreadStress/run executes the ThreadStress test twice: the first time as a normal run, the second time in locks-only mode with stack-dump lock profiling). However, these tests were returning the exit status of last test executed, which could hide a potential earlier failure. This change ensure we return the first failing exit status, if any. Test: art/test/testrunner/testrunner.py Change-Id: I5e4e4cc7d9311fe15637ea2f5248a0e9f2432d61
-rwxr-xr-xtest/004-ThreadStress/run8
-rwxr-xr-xtest/018-stack-overflow/run5
-rwxr-xr-xtest/116-nodex2oat/run6
-rwxr-xr-xtest/117-nopatchoat/run6
-rw-r--r--test/118-noimage-dex2oat/run10
-rw-r--r--test/119-noimage-patchoat/run13
-rwxr-xr-xtest/126-miranda-multidex/run5
-rwxr-xr-xtest/137-cfi/run5
-rwxr-xr-xtest/909-attach-agent/run6
9 files changed, 60 insertions, 4 deletions
diff --git a/test/004-ThreadStress/run b/test/004-ThreadStress/run
index 3851d739ea..8004036868 100755
--- a/test/004-ThreadStress/run
+++ b/test/004-ThreadStress/run
@@ -16,7 +16,13 @@
# Enable lock contention logging.
${RUN} --runtime-option -Xlockprofthreshold:10 "${@}"
+return_status1=$?
# Run locks-only mode with stack-dump lock profiling. Reduce the number of total operations from
# the default 1000 to 100.
-${RUN} --runtime-option -Xlockprofthreshold:10 --runtime-option -Xstackdumplockprofthreshold:20 "${@}" Main --locks-only -o 100
+${RUN} --runtime-option -Xlockprofthreshold:10 --runtime-option -Xstackdumplockprofthreshold:20 \
+ "${@}" Main --locks-only -o 100
+return_status2=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2)
diff --git a/test/018-stack-overflow/run b/test/018-stack-overflow/run
index 1a71a1a5d8..7443bd742b 100755
--- a/test/018-stack-overflow/run
+++ b/test/018-stack-overflow/run
@@ -17,7 +17,12 @@
# Run normal. This will be the debug build.
echo "libartd run."
${RUN} "${@}"
+return_status1=$?
# Run non-debug.
echo "libart run."
${RUN} "${@/#libartd.so/libart.so}"
+return_status2=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2)
diff --git a/test/116-nodex2oat/run b/test/116-nodex2oat/run
index 2cdb3f7b46..d7984cece2 100755
--- a/test/116-nodex2oat/run
+++ b/test/116-nodex2oat/run
@@ -27,11 +27,17 @@ fi
# Make sure we can run without an oat file.
echo "Run -Xnodex2oat"
${RUN} ${flags} --runtime-option -Xnodex2oat
+return_status1=$?
# Make sure we can run with the oat file.
echo "Run -Xdex2oat"
${RUN} ${flags} --runtime-option -Xdex2oat
+return_status2=$?
# Make sure we can run with the default settings.
echo "Run default"
${RUN} ${flags}
+return_status3=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2) && (exit $return_status3)
diff --git a/test/117-nopatchoat/run b/test/117-nopatchoat/run
index c634900218..0627fe5069 100755
--- a/test/117-nopatchoat/run
+++ b/test/117-nopatchoat/run
@@ -37,11 +37,17 @@ fi
# Make sure we can run without relocation
echo "Run without dex2oat/patchoat"
${RUN} ${flags} --runtime-option -Xnodex2oat
+return_status1=$?
# Make sure we can run with the oat file.
echo "Run with dexoat/patchoat"
${RUN} ${flags} --runtime-option -Xdex2oat
+return_status2=$?
# Make sure we can run with the default settings.
echo "Run default"
${RUN} ${flags}
+return_status3=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2) && (exit $return_status3)
diff --git a/test/118-noimage-dex2oat/run b/test/118-noimage-dex2oat/run
index 07bdb08785..e1e2577ae3 100644
--- a/test/118-noimage-dex2oat/run
+++ b/test/118-noimage-dex2oat/run
@@ -48,15 +48,23 @@ bpath_arg="--runtime-option -Xbootclasspath:${bpath}"
# Make sure we can run without an oat file.
echo "Run -Xnoimage-dex2oat"
${RUN} ${flags} ${bpath_arg} --runtime-option -Xnoimage-dex2oat --runtime-option -Xnodex2oat
+return_status1=$?
# 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
+${RUN} ${flags} ${bpath_arg} --runtime-option -Xnoimage-dex2oat --runtime-option -Xnodex2oat \
+ --runtime-option -Xno-dex-file-fallback
+return_status2=$?
# Make sure we can run with the oat file.
echo "Run -Ximage-dex2oat"
${RUN} ${flags} ${bpath_arg} --runtime-option -Ximage-dex2oat
+return_status3=$?
# Make sure we can run with the default settings.
echo "Run default"
${RUN} ${flags} ${bpath_arg}
+return_status4=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2) && (exit $return_status3) && (exit $return_status4)
diff --git a/test/119-noimage-patchoat/run b/test/119-noimage-patchoat/run
index 02a64f8ada..a5877cb7b6 100644
--- a/test/119-noimage-patchoat/run
+++ b/test/119-noimage-patchoat/run
@@ -31,16 +31,25 @@ fi
# Make sure we can run without an image file.
echo "Run -Xnoimage-dex2oat -Xpatchoat:/system/bin/false"
-${RUN} ${flags} ${BPATH} --runtime-option -Xnoimage-dex2oat --runtime-option -Xpatchoat:${false_bin}
+${RUN} ${flags} ${BPATH} --runtime-option -Xnoimage-dex2oat \
+ --runtime-option -Xpatchoat:${false_bin}
+return_status1=$?
# Make sure we cannot run without an image file without fallback.
echo "Run -Xnoimage-dex2oat -Xpatchoat:/system/bin/false -Xno-dex-file-fallback"
-${RUN} ${flags} ${BPATH} --runtime-option -Xnoimage-dex2oat --runtime-option -Xpatchoat:${false_bin} --runtime-option -Xno-dex-file-fallback
+${RUN} ${flags} ${BPATH} --runtime-option -Xnoimage-dex2oat \
+ --runtime-option -Xpatchoat:${false_bin} --runtime-option -Xno-dex-file-fallback
+return_status2=$?
# Make sure we can run with the image file.
echo "Run -Ximage-dex2oat"
${RUN} ${flags} ${BPATH} --runtime-option -Ximage-dex2oat
+return_status3=$?
# Make sure we can run with the default settings.
echo "Run default"
${RUN} ${flags} ${BPATH}
+return_status4=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2) && (exit $return_status3) && (exit $return_status4)
diff --git a/test/126-miranda-multidex/run b/test/126-miranda-multidex/run
index 23c9935c1c..abd63cba0d 100755
--- a/test/126-miranda-multidex/run
+++ b/test/126-miranda-multidex/run
@@ -15,7 +15,12 @@
# limitations under the License.
${RUN} $@
+return_status1=$?
# The problem was first exposed in a no-verify setting, as that changes the resolution path
# taken. Make sure we also test in that environment.
${RUN} --no-verify ${@}
+return_status2=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2)
diff --git a/test/137-cfi/run b/test/137-cfi/run
index adea71a07f..9190b1cf10 100755
--- a/test/137-cfi/run
+++ b/test/137-cfi/run
@@ -21,6 +21,7 @@
${RUN} "$@" -Xcompiler-option --generate-debug-info \
--runtime-option -Xjitthreshold:0 \
--args --full-signatures --args --test-local --args --test-remote
+return_status1=$?
# Test with minimal compressed debugging information.
# Check only method names (parameters are omitted to save space).
@@ -28,3 +29,7 @@ ${RUN} "$@" -Xcompiler-option --generate-debug-info \
${RUN} "$@" -Xcompiler-option --generate-mini-debug-info \
--runtime-option -Xjitthreshold:0 \
--args --test-remote
+return_status2=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2)
diff --git a/test/909-attach-agent/run b/test/909-attach-agent/run
index 4a2eb34a1d..a556bbaffe 100755
--- a/test/909-attach-agent/run
+++ b/test/909-attach-agent/run
@@ -25,9 +25,15 @@ fi
--android-runtime-option -Xcompiler-option \
--android-runtime-option --debuggable \
--args agent:${agent}=909-attach-agent
+return_status1=$?
./default-run "$@" --android-runtime-option -Xcompiler-option \
--android-runtime-option --debuggable \
--args agent:${agent}=909-attach-agent
+return_status2=$?
./default-run "$@" --args agent:${agent}=909-attach-agent
+return_status3=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2) && (exit $return_status3)