From 8cbdef8bf6fbf5e15b9ea88a72ddf7344b1b0674 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 11 Dec 2020 13:26:03 +0100 Subject: [PATCH] run-tests: fix CLI Restore the original behavior that was accidentally changed: When no args are given, run the basic test suite. Otherwise, run the given command with default scenario 'default'. Previously, `run-tests.sh build` ran the basic test suite instead of building the default scenario. --- test/run-tests.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/test/run-tests.sh b/test/run-tests.sh index c48064a..8809b3f 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -185,20 +185,22 @@ all() { scenario=netnsRegtest buildTest "$@" } +# An alias for buildTest build() { - if [[ $scenario ]]; then - buildTest "$@" - else - basic "$@" - fi + buildTest "$@" } -command="${1:-build}" -shift || true -if [[ $command != build ]]; then +if [[ $# > 0 && $1 != -* ]]; then + # An explicit command was provided + command=$1 + shift + if [[ $command == eval ]]; then + command=evalTest + fi : ${scenario:=default} -fi -if [[ $command == eval ]]; then - command=evalTest +elif [[ $scenario ]]; then + command=buildTest +else + command=basic fi $command "$@"