-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest
executable file
·46 lines (38 loc) · 816 Bytes
/
test
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
40
41
42
43
44
45
46
#!/bin/env bash
if [ -z $1 ]; then
function fail () {
rm -f tests/out
exit 1
}
for FILE in tests/*.au; do
OUT=`auro --dir dist aulang "$FILE" tests/out`
if [ $? != "0" ]; then
echo "$FILE failed compiling:"
echo $OUT
fail
fi
OUT=`auro tests/out`
if [ $? != "0" ]; then
echo "$FILE failed running:"
echo $OUT
aurodump tests/out
fail
fi
done
for FILE in tests/fail/*.au; do
echo $FILE
auro --dir dist aulang "$FILE" tests/out >> /dev/null
if [ $? != "1" ]; then
echo "$FILE incorrectly succedded compiling"
fail
fi
done
rm -f tests/out
echo "All tests passed"
exit
fi
auro aulang src/$1.au dist/aulang.$1 &&
auro --dir dist aulang.$1 &&
( if [ $1 == "compiler" ]
then aurodump out;
fi )