aboutsummaryrefslogtreecommitdiff
path: root/crosperf/run_tests.sh
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2015-12-17 12:11:23 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-18 00:22:54 +0000
commitc3fdcc2da9c4c56f007199affb5cfa2ae6860ee8 (patch)
treefb8ba5f9e22c888aa601dc92c1ba2b28b79c6158 /crosperf/run_tests.sh
parentf16faa3c13aad409ebdfea30c2ae6a1a03c57ffb (diff)
downloadtoolchain-utils-c3fdcc2da9c4c56f007199affb5cfa2ae6860ee8.tar.gz
Add final status line to run_tests.sh.
Now that run_tests.sh doesn't stop at the first failing test, we need a final status line to tell us how many unittest files it ran and how many passed/failed. This CL does that. Last line of output now looks like this: ALL TESTS PASSED (19 ran) or 3 TESTS FAILED (out of 19) BUG=chromium:570742 TEST=Tested in my directory. Change-Id: I75e5da8e64a9a527b1086b9a314dda1e2fb01678 Reviewed-on: https://chrome-internal-review.googlesource.com/242578 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Rahul Chaudhry <rahulchaudhry@google.com>
Diffstat (limited to 'crosperf/run_tests.sh')
-rwxr-xr-xcrosperf/run_tests.sh24
1 files changed, 19 insertions, 5 deletions
diff --git a/crosperf/run_tests.sh b/crosperf/run_tests.sh
index 24de3eb5..78a2b9fd 100755
--- a/crosperf/run_tests.sh
+++ b/crosperf/run_tests.sh
@@ -3,16 +3,30 @@
# Copyright 2011 Google Inc. All Rights Reserved.
# Author: raymes@google.com (Raymes Khoury)
+# Make sure the base toolchain-utils directory is in our PYTHONPATH before
+# trying to run this script.
export PYTHONPATH+=":.."
-exit_status=0
+
+num_tests=0
+num_failed=0
+
for test in $(find -name \*test.py); do
echo RUNNING: ${test}
+ ((num_tests++))
if ! ./${test} ; then
- echo " "
+ echo
echo "*** Test Failed! (${test}) ***"
- echo " "
- exit_status=1
+ echo
+ ((num_failed++))
fi
done
-exit $exit_status
+echo
+
+if [ ${num_failed} -eq 0 ] ; then
+ echo "ALL TESTS PASSED (${num_tests} ran)"
+ exit 0
+fi
+
+echo "${num_failed} TESTS FAILED (out of ${num_tests})"
+exit 1