OSDN Git Service

run-test: add --never-clean option
authorIgor Murashkin <iam@google.com>
Wed, 10 Jun 2015 22:57:17 +0000 (15:57 -0700)
committerIgor Murashkin <iam@google.com>
Wed, 10 Jun 2015 22:59:11 +0000 (15:59 -0700)
The --never-clean option forces the temporary directory created for
running the test to be retained after run-test finishes execution.

This is useful to help with debugging problems in your run, build,
run-test-jar, etc scripts.

Change-Id: Idc6c767521581deaa80674b583834af05bf027da

test/run-test

index ed33099..ed03321 100755 (executable)
@@ -96,6 +96,7 @@ basic_verify="false"
 gc_verify="false"
 gc_stress="false"
 always_clean="no"
+never_clean="no"
 have_dex2oat="yes"
 have_patchoat="yes"
 have_image="yes"
@@ -270,6 +271,9 @@ while true; do
     elif [ "x$1" = "x--always-clean" ]; then
         always_clean="yes"
         shift
+    elif [ "x$1" = "x--never-clean" ]; then
+        never_clean="yes"
+        shift
     elif [ "x$1" = "x--dex2oat-swap" ]; then
         run_args="${run_args} --dex2oat-swap"
         shift
@@ -472,6 +476,7 @@ if [ "$usage" = "yes" ]; then
         echo "    --gcstress            Run with gc stress testing"
         echo "    --gcverify            Run with gc verification"
         echo "    --always-clean        Delete the test files even if the test fails."
+        echo "    --never-clean         Keep the test files even if the test succeeds."
         echo "    --android-root [path] The path on target for the android root. (/system by default)."
         echo "    --dex2oat-swap        Use a dex2oat swap file."
     ) 1>&2
@@ -668,7 +673,7 @@ fi
 ) 1>&2
 
 # Clean up test files.
-if [ "$always_clean" = "yes" -o "$good" = "yes" ]; then
+if [ "$always_clean" = "yes" -o "$good" = "yes" ] && [ "$never_clean" = "no" ]; then
     cd "$oldwd"
     rm -rf "$tmp_dir"
     if [ "$target_mode" = "yes" -a "$build_exit" = "0" ]; then