mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-09 15:10:18 +00:00
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.
12 lines
675 B
Text
12 lines
675 B
Text
include_extra_target.bi was included! Include count: 1
|
|
include_extra_target.bi was included! Include count: 2
|
|
include_extra_target.bi was included! Include count: 3
|
|
include_extra_target.bi was included! Include count: 4
|
|
include_extra_target.bi was included! Include count: 5
|
|
include_extra_target.bi was included! Include count: 6
|
|
include_extra_target.bi was included! Include count: 7
|
|
include_extra_target.bi was included! Include count: 8
|
|
include_extra_target.bi was included! Include count: 9
|
|
include_extra_target.bi was included! Include count: 10
|
|
include_extra_target.bi was included! Include count: 11
|
|
include_extra_target.bi was included! Include count: 12
|