Setup testing system using assert.sh

This commit is contained in:
2013-06-26 21:43:42 +02:00
parent 21a0f78f41
commit 5abbdd7853
3 changed files with 174 additions and 0 deletions

30
test/run.sh Executable file
View File

@@ -0,0 +1,30 @@
#! /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")"
testfiles="$(find "$testdir" -name "*-test.sh")"
for testfile in $testfiles; do
echo "running: ${testfile/#$(dirname "$testdir")\//}"
cd "$(dirname "$testfile")"
"$testfile"
echo ""
done