summaryrefslogtreecommitdiff
path: root/tests/run_script_test.sh
blob: cef7adddafdf6e57ed683abaabfaa0ab3fa390cd (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
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

input=$1

input=${input#*/tests/scripts/}
expected=${input%%/*}
ext=${input##*.}

check()
{
	status=$1
	case $expected in
		bad)
			[ "$status" -ne 0 ]
			;;
		*)
			[ "$status" -eq 0 ]
			;;
	esac
	if [ "$?" -ne 0 ]; then
		exit 1
	fi
}

"$1"
check $?

case "$ext" in
	aplwc)
		aplwc "$1"
		check $?
		;;
esac

case $expected in
	*)
		"$srcdir/tests/scripts/simfail.sh" "$1"
		check $?
esac