diff options
Diffstat (limited to 'tests/test-lib.sh')
-rw-r--r-- | tests/test-lib.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test-lib.sh b/tests/test-lib.sh new file mode 100644 index 0000000..d33e443 --- /dev/null +++ b/tests/test-lib.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +: ${APK=apk} ${SRC=.} +T_MODE="$1" +shift 1 +case "$T_MODE" in +--all) + t_case() { true; } + t_end() { exit 0; } + set -e -o pipefail + ;; +--list) + t_case() { echo "$@"; false; } + t_end() { exit 0; } + ;; +--test) + T_WANTED_CASE="$1" + shift + t_case() { [ "$@" = "$T_WANTED_CASE" ]; } + t_end() { exit 0; } + set -e -o pipefail + ;; +*) + echo "invalid mode" + exit 1 + ;; +esac |