Rename test_tests.sh to test_tests_cli.sh

Also allow it to be run from its folder (by looking for ../bin/cli)
This commit is contained in:
southerntofu 2022-02-21 00:39:21 +01:00
parent 9025ef5eef
commit f0cd857305
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,7 @@
# If you give first argument it will be a path to already cloned whck
# 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"
@ -20,12 +21,16 @@ if [ -z "$1" ]; then
# When no explicit dir, try ./ first, otherwise make a temporary dir
if [ -x bin/cli ]; then
testVariousScenarios
elif [ -x ../bin/cli ]; then
cd ..
testVariousScenarios
else
TMPDIR="$(mktemp -d)"
cd "$TMPDIR"
git clone --recursive https://tildegit.org/forge/whck
cd whck
testVariousScenarios
cd "$ORIGDIR"
rm -rf "$TMPDIR"
fi
else