mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-28 11:17:46 +00:00
Add support for custom flags on QB64 tests
This commit is contained in:
parent
d928e5d8ba
commit
adb52f4f04
2 changed files with 11 additions and 1 deletions
|
@ -17,6 +17,9 @@ the program compiled from the `*.bas` file should produce. For `*.err` tests,
|
|||
the `*.err` file contains the text of the error the QB64-PE compiler should
|
||||
produce when attempting to compile that code.
|
||||
|
||||
Tests can also have an optional `*.flags` file. The contents of this file will
|
||||
be provide as command line arguments to QB64-PE when compiling the test source.
|
||||
|
||||
These tests are run via the `./tests/compile_tests.sh` script. The script
|
||||
searches the `./tests/compile_tests` directory for any `*.bas` files, and then
|
||||
uses the provide QB64-PE compiler to test them.
|
||||
|
|
|
@ -50,7 +50,14 @@ do
|
|||
|
||||
compileResultOutput="$RESULTS_DIR/$category-$testName-compile_result.txt"
|
||||
|
||||
"$QB64" -q -x "./tests/compile_tests/$category/$testName.bas" -o "$EXE" 1>"$compileResultOutput"
|
||||
# A .flags file contains any extra compiler flags to provide to QB64 for this test
|
||||
compilerFlags=
|
||||
if test -f "./tests/compile_tests/$category/$testName.flags"; then
|
||||
compilerFlags=$(cat "./tests/compile_tests/$category/$testName.flags")
|
||||
fi
|
||||
|
||||
# -m and -q make sure that we get predictable results
|
||||
"$QB64" $compilerFlags -m -q -x "./tests/compile_tests/$category/$testName.bas" -o "$EXE" 1>"$compileResultOutput"
|
||||
ERR=$?
|
||||
cp_if_exists ./internal/temp/compilelog.txt "$RESULTS_DIR/$category-$testName-compilelog.txt"
|
||||
|
||||
|
|
Loading…
Reference in a new issue