Rename test/run.sh to test.sh

This commit is contained in:
2013-10-20 22:51:08 +01:00
parent 4cfc03ebc2
commit 7dd4458031
2 changed files with 2 additions and 2 deletions

32
test.sh Executable file
View File

@@ -0,0 +1,32 @@
#! /usr/bin/env bash
resolve_link() {
$(type -p greadlink readlink | head -1) $1
}
abs_dirname() {
local cwd="$(pwd)"
local path="$1"
while [ -n "$path" ]; do
cd "${path%/*}"
local name="${path##*/}"
path="$(resolve_link "$name" || true)"
done
pwd
cd "$cwd"
}
testdir="$(abs_dirname "$0")/test"
testfiles="$(find "$testdir" -name "*-test.sh")"
RET=0
for testfile in $testfiles; do
echo "running: ${testfile/#$(dirname "$testdir")\//}"
cd "$(dirname "$testfile")"
"$testfile"
if [ "$?" != "0" ]; then RET=1; fi
done
exit $RET