-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathci-test.sh
More file actions
executable file
·67 lines (59 loc) · 1.24 KB
/
ci-test.sh
File metadata and controls
executable file
·67 lines (59 loc) · 1.24 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
declare -a implementations=($(scheme-env list -l))
echo "Preparing for Chez Scheme"
create_symlink() {
flag=$1
target=$2
src=$3
if [ ! ${flag} ${src} ]; then
ln -s ${target} ${src}
fi
}
create_symlink -f %3a64.chezscheme.sls tests/lib/srfi/:64.sls
create_symlink -d %3a64 tests/lib/srfi/:64
check_output() {
local status=0
while IFS= read -r LINE; do
echo $LINE
case $LINE in
*FAIL*) status=255 ;;
*Exception*) status=255 ;;
esac
done
return ${status}
}
EXIT_STATUS=0
echo "Preparing for tests"
gcc -fPIC -shared -Wall -o tests/functions.so tests/functions.c
cd tests
for impl in ${implementations[@]}; do
echo Testing with ${impl}
name=${impl%@*}
for file in *.scm; do
case $file in
$name.test.scm)
scheme-env run ${impl} \
--loadpath ../src \
--loadpath lib \
--standard r6rs --program ${file} | check_output
;;
test.scm)
scheme-env run ${impl} \
--loadpath ../src \
--loadpath lib \
--standard r6rs --program ${file} | check_output
;;
*)
# Do nothing
;;
esac
case ${EXIT_STATUS} in
0) EXIT_STATUS=$? ;;
esac
done
echo Done!
echo
done
cd ..
echo Library test status ${EXIT_STATUS}
exit ${EXIT_STATUS}