2022-04-28 23:30:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Arg 1: qb54 location
|
|
|
|
|
|
|
|
PREFIX="QBasic"
|
|
|
|
|
|
|
|
RESULTS_DIR="./tests/results/$PREFIX"
|
2022-05-06 20:59:43 +00:00
|
|
|
EXES_DIR="./tests/exes/$PREFIX"
|
2022-04-28 23:30:07 +00:00
|
|
|
|
|
|
|
mkdir -p $RESULTS_DIR
|
2022-05-06 20:59:43 +00:00
|
|
|
mkdir -p $EXES_DIR
|
2022-04-28 23:30:07 +00:00
|
|
|
|
|
|
|
QB64=$1
|
|
|
|
|
|
|
|
show_failure()
|
|
|
|
{
|
|
|
|
cat "$RESULTS_DIR/$1-compile_result.txt"
|
|
|
|
cat "$RESULTS_DIR/$1-compilelog.txt"
|
|
|
|
}
|
|
|
|
|
|
|
|
for sourceFile in $(find ./tests/qbasic_testcases/n54/ -name '*.bas') \
|
|
|
|
./tests/qbasic_testcases/open_gl/*.bas \
|
|
|
|
$(find ./tests/qbasic_testcases/pete -name '*.bas') \
|
|
|
|
$(find ./tests/qbasic_testcases/qb45com -name '*.bas') \
|
|
|
|
$(find ./tests/qbasic_testcases/thebob -name '*.bas') \
|
|
|
|
./tests/qbasic_testcases/misc/*.bas
|
|
|
|
do
|
|
|
|
test=$(basename $sourceFile .bas)
|
|
|
|
|
|
|
|
TESTCASE=$test
|
|
|
|
|
2022-05-11 00:11:51 +00:00
|
|
|
# Clear out temp folder before next compile, avoids stale compilelog files
|
|
|
|
rm -fr ./internal/temp/*
|
|
|
|
|
2022-05-06 20:59:43 +00:00
|
|
|
"$QB64" -x "$sourceFile" -o "./$EXES_DIR/$test-output.exe" 1>$RESULTS_DIR/$test-compile_result.txt
|
2022-04-28 23:30:07 +00:00
|
|
|
ERR=$?
|
2022-05-11 00:11:26 +00:00
|
|
|
cp_if_exists ./internal/temp/compilelog.txt $RESULTS_DIR/$test-compilelog.txt
|
2022-04-28 23:30:07 +00:00
|
|
|
|
|
|
|
(exit $ERR)
|
|
|
|
assert_success_named "Compile" "Compilation Error:" show_failure $test
|
|
|
|
done
|