Commit 542ab53
committed
tests.rs: Read executable binary location from environment at runtime
This commit changes how the `CARGO_BIN_EXE_coreutils` environment variable
is read. Previously, it was read using the `env!` macro, which returns the
value of the variable as exposed by cargo during compilation.
The problem with that is that it renders the process of testing for cross
compiled targets, similar to what build systems like Yocto do, more
difficult.
The solution to this is to read said variable at runtime and if it is not
defined, to default to the version offered by cargo. This way ensures that
first of all, current functionality remains unchanged and that the code can
be more easily cross compiled and tested in environments outside of cargo.
Also, this commit closes #9246 .
Signed-off-by: Andreas Stergiopoulos <andreas.stergiopoulos@smile.fr>1 parent 9f28bf0 commit 542ab53
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
0 commit comments