summaryrefslogtreecommitdiff
path: root/test/run-lang-tests.sh
blob: ecdb6fe5dc0255dfc26b3de52148126736056300 (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
28
29
30
31
32
#!/bin/bash

has_failed=0
cd "$(dirname $0)"
EXECUTABLE="$PWD/../hence"

echo $PWD

for src in invalid-hence/*.hence ; do
	outfile="$(mktemp)"
	"$EXECUTABLE" "$src" 2> "$outfile"
	if diff "$src.expected" "$outfile" ; then
		echo -ne '[\e[0;32mPASS\e[0m]'
		rm "$outfile"
	else
		echo -ne '[\e[1;31mFAIL\e[0m]'
		has_failed=1
	fi
	echo " $src"
done

exit $has_failed

#for src in valid-hence/*.hence ; do
#	outfile="$(mktemp)"
#	"$EXECUTABLE" "$src" > "$outfile"
#	if diff "$src.expected" "$outfile" >/dev/null ; then
#		echo "$src: PASS"
#	else
#		echo "$src: FAIL"
#	fi
#done