From 8cbc8bc716d7a47019ad14403920c72547b2fb96 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 4 Oct 2011 11:19:45 -0700 Subject: 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 --- test/run-all-tests | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'test/run-all-tests') 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 -- cgit v1.1