art/test: support sequential run

Introduce --seq option for art/test/run-all-tests.
This option runs tests one-by-one, avoiding failures
caused by busy CPU

Change-Id: Ibe29f749d267fb05dff4617787c7afcbdbeb43c0
Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
diff --git a/test/run-test b/test/run-test
index 6e59641..1c5904f 100755
--- a/test/run-test
+++ b/test/run-test
@@ -33,7 +33,7 @@
 progdir=`pwd`
 prog="${progdir}"/`basename "${prog}"`
 test_dir="test-$$"
-tmp_dir="/tmp/${test_dir}"
+tmp_dir="/tmp/$USER/${test_dir}"
 
 export JAVA="java"
 export JAVAC="javac -g"
@@ -165,6 +165,7 @@
         break
     fi
 done
+mkdir -p $tmp_dir
 
 if [ ! "$runtime" = "jvm" ]; then
   run_args="${run_args} --lib $lib"
@@ -356,7 +357,7 @@
     cd "$oldwd"
     rm -rf "$tmp_dir"
     if [ "$target_mode" = "yes" -a "$build_exit" = "0" ]; then
-        adb shell rm -r $DEX_LOCATION
+        adb shell rm -rf $DEX_LOCATION
     fi
     exit 0
 fi