Skip to content

Commit

Permalink
fbc-tests: add script to run cpp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jayrm committed Jun 13, 2021
1 parent dfd967f commit 8735c89
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions tests/cpp/mk-tests-cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

function chk() {
rm -f $1-cpp.o
make -f $1.bmk CFLAGS="-m64 -O0"
fbc -g -exx $1-fbc.bas $1-cpp.o -x $1-fbc.exe $2
./$1-fbc.exe
}

function do_clean() {
rm -f $1-cpp.o
rm -f $1-fbc.exe
rm -f $1-fbc.o
}

function do_clean_all() {
do_clean "mangle"
do_clean "call"
do_clean "call2"
do_clean "this"
do_clean "class"
do_clean "bop"
do_clean "fbcall"
do_clean "derived"
}

function chk_all() {
# chk "mangle" "-gen gas"
chk "mangle" "-gen gcc"

# chk "call" "-gen gas"
chk "call" "-gen gcc"

# chk "call2" "-gen gas"
chk "call2" "-gen gcc"

# chk "this" "-gen gas"
chk "this" "-gen gcc"

# chk "class" "-gen gas"
chk "class" "-gen gcc"

# chk "bop" "-gen gas"
chk "bop" "-gen gcc"

# chk "fbcall" "-gen gas"
chk "fbcall" "-gen gcc"

# chk "derived" "-gen gas"
chk "derived" "-gen gcc"
}

if [ -z "$1" ]; then
chk_all
exit 0
fi

case $1 in
mangle|call|call2|this|class|bop|fbcall|derived)
chk "$1" "-gen gcc"
;;
clean)
do_clean_all
;;
*)
echo "expected clean|mangle|call|call2|this|class|bop|fbcall|derived"
;;
esac

0 comments on commit 8735c89

Please sign in to comment.