Add test_tests.sh which runs tests from various setups
Checks that absolute and relative links work Fix an error in test_cli.sh which produced the error: ERROR test_cli.sh failed from spec/tests folder with implicit ../../cli
This commit is contained in:
parent
9b18c0e162
commit
24bfd29c0f
|
@ -12,7 +12,7 @@ export FORGEHOOK="$(pwd)/tests/mock-forgehook.sh"
|
|||
source tests/helper.bash
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
output="$(findBin "$SCRIPTDIR"/../cli)"
|
||||
output="$(findBin ../cli)"
|
||||
if [ $? -eq 0 ]; then
|
||||
if [[ "$(echo "$output" | wc -l)" == "1" ]]; then
|
||||
FIND_WHCK="$output"
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
#! /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"
|
Loading…
Reference in New Issue