summaryrefslogtreecommitdiffstats
path: root/test/run-all-tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-10-04 11:19:45 -0700
committerElliott Hughes <enh@google.com>2011-10-04 11:24:27 -0700
commit8cbc8bc716d7a47019ad14403920c72547b2fb96 (patch)
tree58f2a58cb52de0a9ea36eeb8e4ddd6a0861b698a /test/run-all-tests
parent58ae9416e197ae68ed12ed43d87407d4dfb15093 (diff)
downloadart-8cbc8bc716d7a47019ad14403920c72547b2fb96.zip
art-8cbc8bc716d7a47019ad14403920c72547b2fb96.tar.gz
art-8cbc8bc716d7a47019ad14403920c72547b2fb96.tar.bz2
Use a test-specific name for each generated file.
This lets us run multiple tests in parallel (and know what we've got lying around on our devices). Change-Id: I90ecc4ceaae0ee4b323d861c2b408e2944a2f8c1
Diffstat (limited to 'test/run-all-tests')
-rwxr-xr-xtest/run-all-tests39
1 files changed, 22 insertions, 17 deletions
diff --git a/test/run-all-tests b/test/run-all-tests
index f66cd76..94c7c31 100755
--- a/test/run-all-tests
+++ b/test/run-all-tests
@@ -100,25 +100,30 @@ if [ "$usage" = "yes" ]; then
exit 1
fi
-passed=0
-failed=0
-failNames=""
+# 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
-for i in *; do
- if [ -d "$i" -a -r "$i" -a -r "${i}/info.txt" ]; then
- ./run-test ${run_args} "$i"
- if [ "$?" = "0" ]; then
- ((passed += 1))
- else
- ((failed += 1))
- failNames="$failNames $i"
- fi
- fi
+# wait for all the tests, collecting the failures
+failure_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]"
+ fi
done
-echo "passed: $passed test(s)"
-echo "failed: $failed test(s)"
+echo "failed tests: $failure_count"
-for i in $failNames; do
- echo "failed: $i"
+for i in $failed_test_names; do
+ echo "failed: $i"
done