Currently, the get_srcdir() function in cdefs.py tries to find the source directory by walking up the path from it's main module. However, this may not necessarily be located where the src directory actually is depending on how it is ran and imported. However, it also checks the SRC_DIR environment variable. This commit ensures this environment variable is always set based on the config, or an override environment variable. This way cdefs.py can always find the sources files it requires.
Details
Details
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Passed Severity Location Code Message Auto-Fix test/functional/test_runner.py:1 CFMT Code style violation - Unit
No Test Coverage - Build Status
Buildable 4182 Build 6430: Bitcoin ABC Buildbot (legacy) Build 6429: arc lint + arc unit
Event Timeline
test/functional/test_runner.py | ||
---|---|---|
143 | If src_dir already has a value from above, I think this check should fail with an error saying src_dir is defined twice |
test/functional/test_runner.py | ||
---|---|---|
143 | src_dir will always be defined by the config setup by ./configure |
test/functional/test_runner.py | ||
---|---|---|
143 | Do we have a reason to think that ./configure may sometime be wrong ? |
test/functional/test_runner.py | ||
---|---|---|
143 | I don't, but this is fixing incongruent behavior between get_srcdir() and the main script here. As for the environment variable, depending on how the tests are ran, get_scrdir() make not be able to find the srcdir. It's not particularly nice, but setting the environment variable is a fix. |