3 SRCDIR
="$(dirname "$0")"
16 SRCDIR
="$(absolute "$SRCDIR")"
19 # Set env for the scripts and test scripts:
20 readonly DATADIR
="$SRCDIR"
21 if [[ "$PATH" ]]; then
22 readonly PATH
="$SRCDIR:$PATH"
24 readonly PATH
="$SRCDIR"
31 readonly TESTS
=("$SRCDIR"/tests
/*.sh
)
35 for t
in "${TESTS[@]}"; do
36 echo -n "################################### "
37 echo "Running $(basename "$t")..."
39 # The absolute path will be needed after a pushd:
42 # Clean up what has been left by previous tests:
43 rm -rf "$TMP"/test-gitgitconfig
45 mkdir
"$TMP"/test-gitgitconfig
46 pushd "$TMP"/test-gitgitconfig
47 if "$t"; then echo OK
; else echo FAILED
; let '++ status'; fi
51 echo "$status tests failed."
53 # Clean up if there have been no errors. Otherwise leave it for inspection.
54 if (( status
== 0 )); then
55 rm -rf "$TMP"/test-gitgitconfig