1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-01 10:10:15 +00:00
QB64-PE/tests/compile_tests/include_paths
Matthew Kilgore 094a8c82b2 Fix compiling bas files relative to the CWD
Fix was pulled from QB64Official/qb64#17 by Cory Smith, I just added
tests around it.

Most (all?) compilers allow you to run the compiler from a separate
directory than the compiler itself is located in and compile source
files relative to that directory. QB64-PE however does not allow that,
for a variety of reasons it always search for the provided source file
relative to the location of the QB64-PE compiler rather than the CWD it
was run from. This is pretty unexpected behavior in a lot of cases, and
also doesn't give very helpful error messages either.

This change has us check if the source file exists at the given CWD
location, and if it does we will prepend the CWD to produce the correct
path to the file.

To test that this behavior works as expected I modified
`compile_test.sh` to compile from within the test directories using a
relative path directly to the test file, this fails with current QB64-PE
versions because it can't find the source file.

Additionally, I was unsure of whether this would impact the behavior of
`'$include`, so I added some tests around include that uses various
combinations of paths relative to QB64-PE and relative to the source
file being compiled, and they all find the files as expected so I think
it's fine.
2022-09-30 17:13:43 -04:00
..
include_fixed_compile_location.bas Fix compiling bas files relative to the CWD 2022-09-30 17:13:43 -04:00
include_fixed_compile_location.output Fix compiling bas files relative to the CWD 2022-09-30 17:13:43 -04:00
include_multiple.bas Fix compiling bas files relative to the CWD 2022-09-30 17:13:43 -04:00
include_multiple.output Fix compiling bas files relative to the CWD 2022-09-30 17:13:43 -04:00
include_relative.bas Fix compiling bas files relative to the CWD 2022-09-30 17:13:43 -04:00
include_relative.output Fix compiling bas files relative to the CWD 2022-09-30 17:13:43 -04:00