From e0b24f96096e8f674a2ffe30f7c85a42c191a595 Mon Sep 17 00:00:00 2001 From: David Stanek Date: Thu, 16 Jan 2014 19:29:56 +0000 Subject: [PATCH] Adds run_tests.sh cli option to stop on failure Change-Id: I77def7f99b1e9c29649afb74e76948e375fa2980 --- run_tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index e33cf3aabe..f2086d519f 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -42,6 +42,7 @@ function process_option { -h|--help) usage;; -V|--virtual-env) always_venv=1; never_venv=0;; -N|--no-virtual-env) always_venv=0; never_venv=1;; + -x|--stop) failfast=1;; -f|--force) force=1;; -u|--update) update=1;; -p|--pep8) just_flake8=1;; @@ -58,6 +59,7 @@ with_venv=tools/with_venv.sh always_venv=0 never_venv=0 force=0 +failfast=0 testrargs= testropts=--subunit wrapper="" @@ -81,6 +83,9 @@ fi function run_tests { set -e echo ${wrapper} + if [ $failfast -eq 1 ]; then + testrargs="$testrargs -- --failfast" + fi ${wrapper} $TESTRTESTS --testr-args="$testropts $testrargs" | \ ${wrapper} subunit-2to1 | \ ${wrapper} tools/colorizer.py