mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 10:06:39 +00:00
Setup testing system using assert.sh
This commit is contained in:
30
test/run.sh
Executable file
30
test/run.sh
Executable 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
|
||||
Reference in New Issue
Block a user