-
Notifications
You must be signed in to change notification settings - Fork 42
/
run-tests
executable file
·46 lines (40 loc) · 1 KB
/
run-tests
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
# If you modify the behaviour of this file please remember to update the
# relevant wiki page:
#
# https://github.com/links-lang/links/wiki/Running-the-test-suite
ret=0
if [[ $1 != "db-only" ]]; then
for i in tests/*.tests; do
cmnd="./test-harness $i"
echo cmnd=$cmnd
eval $cmnd
ret_code=$?
if [ $ret_code != 0 ]; then
ret=1
fi
done
fi
if [[ $1 != "no-db" ]]; then
for s in tests/database/*.sql; do
cmnd="psql -v ON_ERROR_STOP=1 -q -U postgres -d links -f $s"
echo cmnd=$cmnd
eval $cmnd
ret_code=$?
if [ $ret_code != 0 ]; then
echo "FAILED DATABASE PREPARATION $s"
ret=1
fi
done
for t in tests/database/*.links; do
cmnd="./links --config=tests/database/config $t"
echo cmnd=$cmnd
eval $cmnd
ret_code=$?
if [ $ret_code != 0 ]; then
echo "FAILED TEST $t"
ret=1
fi
done
fi
exit $ret