mirror of
https://github.com/sharkdp/fd.git
synced 2026-06-09 15:37:26 +02:00
b6af107ac6
This commit changes the way that the binary executable of fd is located during integration tests. Previously, the find_fd_exe function would just navigate in the parent directory and try to find the binary here. This method is not appropriate as it assumes that the test directory will have the same layout as the build directory, which also leaks the build time configuration. With this patch, the location of the binary executable is read using the CARGO_BIN_EXE_fd environment variable. The code at first tries to read the variable at run time, and if it is not available it then uses the env! macro which returns the value of the variable exposed at compile time. This way of reading the binary location makes the code more flexible and friendlier to cross compile. This commit closes #1838 . Signed-off-by: Andreas Stergiopoulos <andreas.stergiopoulos@smile.fr>