summaryrefslogtreecommitdiff
path: root/tests.sh
blob: bdec6fdfd1d01c6d37bd9a1427c635bcb863f641 (plain)
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
#!/do/not/execute

DIFF=diff
PTFTOOL=../../ptftool

run_test() {
	echo "$NAME"
	if [ ! -e $FILE ]; then
		echo "Can't find binary"
		echo ""
		exit 2
	fi
	$PTFTOOL $FILE 2> /dev/null > .tmp1
	echo "$EXPECT" > .tmp2
	DIFFED=$($DIFF -U0 .tmp2 .tmp1 | grep -v -E '^\+\+\+ |^--- ')
	rm -f .tmp1 .tmp2
	if [ -z "$DIFFED" ]; then
		echo "[ OK ]"
		echo ""
		exit 0
	else
		echo "$DIFFED"
		echo "[FAIL]"
		echo ""
		exit 1
	fi
}