diff options
author | Dmitry Petrochenko <dmitry.petrochenko@intel.com> | 2014-03-05 15:05:46 +0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2014-05-02 17:28:26 -0700 |
commit | 81c56e73558dee0a8e537a12a210d4bc0ef01a62 (patch) | |
tree | 36d5da7357766bf4f731180f23195e44aa163786 /test | |
parent | 56a341a82ece9aa4f2a071629f3e1fd1adf988ae (diff) | |
download | art-81c56e73558dee0a8e537a12a210d4bc0ef01a62.zip art-81c56e73558dee0a8e537a12a210d4bc0ef01a62.tar.gz art-81c56e73558dee0a8e537a12a210d4bc0ef01a62.tar.bz2 |
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>
Diffstat (limited to 'test')
-rwxr-xr-x | test/run-all-tests | 74 | ||||
-rwxr-xr-x | test/run-test | 5 |
2 files changed, 54 insertions, 25 deletions
diff --git a/test/run-all-tests b/test/run-all-tests index a6675df..3a991e9 100755 --- a/test/run-all-tests +++ b/test/run-all-tests @@ -35,6 +35,7 @@ prog="${progdir}"/`basename "${prog}"` run_args="" usage="no" +sequental="no" while true; do if [ "x$1" = "x--host" ]; then @@ -70,6 +71,12 @@ while true; do elif [ "x$1" = "x--help" ]; then usage="yes" shift + elif [ "x$1" = "x--seq" ]; then + sequental="yes" + shift + elif [ "x$1" = "x-O" ]; then + run_args="${run_args} -O" + shift elif expr "x$1" : "x--" >/dev/null 2>&1; then echo "unknown $0 option: $1" 1>&2 usage="yes" @@ -89,34 +96,55 @@ if [ "$usage" = "yes" ]; then "further documentation:" echo " --debug --dev --host --interpreter --jvm --no-optimize" echo " --no-verify -O --update --valgrind --zygote" + echo " Specific Runtime Options:" + echo " --seq Run tests one-by-one, avoiding failures caused by busy CPU" ) 1>&2 exit 1 fi -# start all the tests -i=0 -for test_name in *; do - if [ -d "$test_name" -a -r "$test_name" -a -r "$test_name/info.txt" ]; then - ./run-test ${run_args} "$test_name" & - test_pids[i]=$! - test_names[test_pids[i]]="$test_name" - let i+=1 - fi -done +if [ "$sequental" == "yes" ]; then + i=0 + for test_name in *; do + if [ -d "$test_name" -a -r "$test_name" -a -r "$test_name/info.txt" ]; then + ./run-test ${run_args} "$test_name" + RES=$? + test_pids[i]=i + test_names[test_pids[i]]="$test_name" + if [ "$RES" != "0" ]; then + let failure_count+=1 + failed_test_names="$failed_test_names ${test_names[i]}" + else + let succeeded_count+=1 + fi + let i+=1 + fi + done +else + # start all the tests + i=0 + for test_name in *; do + if [ -d "$test_name" -a -r "$test_name" -a -r "$test_name/info.txt" ]; then + ./run-test ${run_args} "$test_name" & + test_pids[i]=$! + test_names[test_pids[i]]="$test_name" + let i+=1 + fi + done -# wait for all the tests, collecting the failures -failure_count=0 -succeeded_count=0 -failed_test_names="" -for pid in ${test_pids[@]}; do - wait $pid - if [ "$?" != "0" ]; then - let failure_count+=1 - failed_test_names="$failed_test_names ${test_names[$pid]}[pid=$pid]" - else - let succeeded_count+=1 - fi -done + # wait for all the tests, collecting the failures + failure_count=0 + succeeded_count=0 + failed_test_names="" + for pid in ${test_pids[@]}; do + wait $pid + if [ "$?" != "0" ]; then + let failure_count+=1 + failed_test_names="$failed_test_names ${test_names[$pid]}[pid=$pid]" + else + let succeeded_count+=1 + fi + done +fi echo "succeeded tests: $succeeded_count" echo "failed tests: $failure_count" 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 @@ cd "${progdir}" 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 @@ while true; do break fi done +mkdir -p $tmp_dir if [ ! "$runtime" = "jvm" ]; then run_args="${run_args} --lib $lib" @@ -356,7 +357,7 @@ if [ "$good" == "yes" ]; then 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 |