From d0570c1edbcd695587289b4076e0363efe8b07e6 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Mon, 21 Feb 2022 15:02:01 +0100 Subject: [PATCH] Move test.sh to bin/ and allow test_cli.sh to take absolute path to whck --- test_cli.sh | 6 +++--- test_tests_cli.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test_cli.sh b/test_cli.sh index 962d474..398ae1e 100755 --- a/test_cli.sh +++ b/test_cli.sh @@ -29,10 +29,10 @@ if [ -z "$1" ]; then # cli script needs to be executed to get absolute path to the program export WHCK="$("$FIND_WHCK")" else - if [ -x "$ORIGDIR"/"$1" ]; then - export WHCK="$(realpath "$ORIGDIR"/"$1")" - elif [ -x "$1" ]; then + if [ -f "$ORIGDIR"/"$1" ] && [ -x "$ORIGDIR"/"$1" ]; then export WHCK="$(realpath "$ORIGDIR"/"$1")" + elif [ -f "$1" ] && [ -x "$1" ]; then + export WHCK="$(realpath "$1")" else echo "ERROR: Could not find provided validation program: "$1"" exit 2 diff --git a/test_tests_cli.sh b/test_tests_cli.sh index d701b0b..2d98234 100755 --- a/test_tests_cli.sh +++ b/test_tests_cli.sh @@ -5,13 +5,13 @@ # TODO: save exit codes of various tests so we can know how many failed function testVariousScenarios() { echo "Running various tests from "$(pwd)"" - ./test.sh || echo "ERROR running from repo" + bin/test.sh || echo "ERROR running from repo" cd spec ./test_cli.sh || echo "ERROR test_cli.sh failed with implicit ../cli" ./test_cli.sh "$(../bin/cli)" || echo "ERROR test_cli with explicit result from ../cli" - ../test.sh || echo "ERROR test.sh failed called from spec submodule" + ../bin/test.sh || echo "ERROR test.sh failed called from spec submodule" cd tests - ../../test.sh || echo "ERROR test.sh failed from spec/tests folder" + ../../bin/test.sh || echo "ERROR test.sh failed from spec/tests folder" ../test_cli.sh || echo "ERROR test_cli.sh failed from spec/tests folder with implicit ../../cli" ../test_cli.sh "$(../../bin/cli)" || echo "ERROR test_cli.sh failed from spec/tests folder with explicit result from ../../cli" }