From 51cc2eb3a7a8116e727bcc907a726e5af0a18b0c Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 22 Oct 2012 11:33:29 -0700 Subject: Fix the fail-on-zero-tests case so that it is tolerant of no output Some ways of running run_tests.sh will not output a line for us to parse the count from. Treat no "Ran X tests" as "Ran 0 tests". Change-Id: I96ba13e797ceaf9b9fa2b60ccb558510b5e32a88 --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'run_tests.sh') diff --git a/run_tests.sh b/run_tests.sh index 87a5e3b05..5e31f906a 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -100,7 +100,7 @@ function run_tests { fi else tests_run=$(awk '/^Ran/ {print $2}' nosetests.log) - if [ "$tests_run" -eq 0 ]; + if [ -z "$tests_run" ] || [ "$tests_run" -eq 0 ]; then echo "ERROR: Zero tests ran, something is wrong!" echo "This is usually caused by a parse error in some python" -- cgit