#! /usr/bin/env bash # If you give first argument it will be a path to already cloned whck function testVariousScenarios() { echo "Running various tests from "$(pwd)"" ./test.sh || echo "ERROR running from repo" cd spec ./test_cli.sh || echo "ERROR test_cli.sh failed with implicit ../cli" ./test_cli.sh "$(../cli)" || echo "ERROR test_cli with explicit result from ../cli" ../test.sh || echo "ERROR test.sh failed called from spec submodule" cd tests ../../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 "$(../../cli)" || echo "ERROR test_cli.sh failed from spec/tests folder with explicit result from ../../cli" } ORIGDIR="$(pwd)" if [ -z "$1" ]; then TMPDIR="$(mktemp -d)" cd "$TMPDIR" git clone --recursive https://tildegit.org/forge/whck cd whck testVariousScenarios rm -rf "$TMPDIR" else if [ ! -d "$1" ]; then echo "Wrong repo: "$1"" exit 1 fi cd "$1" testVariousScenarios fi cd "$ORIGDIR"