mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-20 09:04:43 +00:00
094a8c82b2
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.
1 line
31 B
Text
1 line
31 B
Text
include_extra.bi was included!
|