summaryrefslogtreecommitdiff
path: root/tests/test-lib.sh
blob: d33e443151b80440a72149214ba6b9563d563405 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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