From e5dcc234e084d910166e50c31f9eb81d82d85662 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Thu, 11 May 2017 00:36:53 -0700 Subject: [PATCH] Clear odex/vdex/art file before running run-test This allows individual tests to call the RUN script multiple times. Test: ./test/testrunner/testrunner.py [--host|--target] [--no-prebuild] Bug: 38213479 (cherry picked from commit 24bd3f9d63c81f448b7fe1854742fda0343a2297) Change-Id: I9243b448f3601dec02615699a5bca7dd7472de53 --- test/etc/run-test-jar | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 97aa21241..5d7e0ff36 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -643,7 +643,7 @@ if [ "$HOST" = "n" ]; then adb root > /dev/null adb wait-for-device if [ "$QUIET" = "n" ]; then - adb shell rm -r $DEX_LOCATION + adb shell rm -rf $DEX_LOCATION adb shell mkdir -p $DEX_LOCATION adb push $TEST_NAME.jar $DEX_LOCATION adb push $TEST_NAME-ex.jar $DEX_LOCATION @@ -711,6 +711,7 @@ if [ "$HOST" = "n" ]; then rm -f $cmdfile else + # Host run. export ANDROID_PRINTF_LOG=brief # By default, and for prebuild dex2oat, we are interested in errors being logged. In dev mode @@ -767,7 +768,12 @@ else cd $ANDROID_BUILD_TOP + # Make sure we delete any existing compiler artifacts. + # This enables tests to call the RUN script multiple times in a row + # without worrying about interference. + rm -rf ${DEX_LOCATION}/oat rm -rf ${DEX_LOCATION}/dalvik-cache/ + mkdir -p ${mkdir_locations} || exit 1 $profman_cmdline || { echo "Profman failed." >&2 ; exit 2; } $dex2oat_cmdline || { echo "Dex2oat failed." >&2 ; exit 2; } -- 2.11.0