diff --git a/test_cli.sh b/test_cli.sh index 0003da0..962d474 100755 --- a/test_cli.sh +++ b/test_cli.sh @@ -29,13 +29,18 @@ if [ -z "$1" ]; then # cli script needs to be executed to get absolute path to the program export WHCK="$("$FIND_WHCK")" else - if WHCK="$(realpath -q "$ORIGDIR"/"$1")"; then - export WHCK + if [ -x "$ORIGDIR"/"$1" ]; then + export WHCK="$(realpath "$ORIGDIR"/"$1")" + elif [ -x "$1" ]; then + export WHCK="$(realpath "$ORIGDIR"/"$1")" else - export WHCK="$(realpath "$1")" + echo "ERROR: Could not find provided validation program: "$1"" + exit 2 fi fi bats tests/cli/*.bats +status=$? cd "$ORIGDIR" +exit $status