From d86cdee3f313553d11fd5c17fe5c6626e856092f Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 13 Sep 2017 14:17:33 +0200 Subject: [PATCH] Let the test script work on multiple targets --- tests/tests.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/tests.sh b/tests/tests.sh index 493b54c..6e4fac8 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -100,7 +100,7 @@ _tests() #usage _usage() { - echo "Usage: $PROGNAME target" 1>&2 + echo "Usage: $PROGNAME [-c] target..." 1>&2 return 1 } @@ -122,12 +122,16 @@ while getopts "cP:" name; do esac done shift $(($OPTIND - 1)) -if [ $# -ne 1 ]; then +if [ $# -lt 1 ]; then _usage exit $? fi [ "$clean" -ne 0 ] && exit 0 -target="$1" -_tests > "$target" +while [ $# -gt 0 ]; do + target="$1" + shift + + _tests > "$target" || exit 2 +done