Skip to content

Commit 8735c89

Browse files
committed
fbc-tests: add script to run cpp tests
1 parent dfd967f commit 8735c89

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

tests/cpp/mk-tests-cpp.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
3+
function chk() {
4+
rm -f $1-cpp.o
5+
make -f $1.bmk CFLAGS="-m64 -O0"
6+
fbc -g -exx $1-fbc.bas $1-cpp.o -x $1-fbc.exe $2
7+
./$1-fbc.exe
8+
}
9+
10+
function do_clean() {
11+
rm -f $1-cpp.o
12+
rm -f $1-fbc.exe
13+
rm -f $1-fbc.o
14+
}
15+
16+
function do_clean_all() {
17+
do_clean "mangle"
18+
do_clean "call"
19+
do_clean "call2"
20+
do_clean "this"
21+
do_clean "class"
22+
do_clean "bop"
23+
do_clean "fbcall"
24+
do_clean "derived"
25+
}
26+
27+
function chk_all() {
28+
# chk "mangle" "-gen gas"
29+
chk "mangle" "-gen gcc"
30+
31+
# chk "call" "-gen gas"
32+
chk "call" "-gen gcc"
33+
34+
# chk "call2" "-gen gas"
35+
chk "call2" "-gen gcc"
36+
37+
# chk "this" "-gen gas"
38+
chk "this" "-gen gcc"
39+
40+
# chk "class" "-gen gas"
41+
chk "class" "-gen gcc"
42+
43+
# chk "bop" "-gen gas"
44+
chk "bop" "-gen gcc"
45+
46+
# chk "fbcall" "-gen gas"
47+
chk "fbcall" "-gen gcc"
48+
49+
# chk "derived" "-gen gas"
50+
chk "derived" "-gen gcc"
51+
}
52+
53+
if [ -z "$1" ]; then
54+
chk_all
55+
exit 0
56+
fi
57+
58+
case $1 in
59+
mangle|call|call2|this|class|bop|fbcall|derived)
60+
chk "$1" "-gen gcc"
61+
;;
62+
clean)
63+
do_clean_all
64+
;;
65+
*)
66+
echo "expected clean|mangle|call|call2|this|class|bop|fbcall|derived"
67+
;;
68+
esac
69+

0 commit comments

Comments
 (0)