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
Change-Id: Ibbac7404b44ea175a5aba0459dd7c7868c530954
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index f750556..c6ef8ed 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -668,7 +668,7 @@
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
@@ -736,6 +736,7 @@
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
@@ -792,7 +793,12 @@
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; }