-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-tests.sh
executable file
·46 lines (38 loc) · 975 Bytes
/
run-tests.sh
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/bash
TARGET_TRIPLE=$(lli -version | grep 'Default target' | sed 's/.*: \(.*\)/\1/')
TESTS=0
FAILURES=0
FAILURE_OUT=""
test_subsystem() {
SUBSYSTEM=$1
for TEST_FILE in `ls tests/${SUBSYSTEM}/test-*.llisp`; do
TESTS=$(($TESTS + 1))
DIFF=$(lli -mtriple="$TARGET_TRIPLE" test-${SUBSYSTEM}.bc $TEST_FILE | diff -u $TEST_FILE.out -)
if [ $? == 0 ]
then
echo -n "."
else
FAILURES=$(($FAILURES + 1))
FAILURE_OUT="${FAILURE_OUT}\nFailure in ${TEST_FILE}:\n\n${DIFF}\n"
echo -n "F"
fi
done
}
for SUBSYSTEM in `ls tests`; do
if [ -d "tests/$SUBSYSTEM" ]
then
test_subsystem $SUBSYSTEM
else
echo "Not a subsystem $SUBSYSTEM"
fi
done
if [ $FAILURES == 0 ]
then
echo -e "\nSuccess!"
else
echo -e "\n"
printf "${FAILURE_OUT}"
echo -e "\n${FAILURES} of ${TESTS} Tests Failed"
exit 1
fi
echo -e "\nRan ${TESTS} tests"