This PR includes changes split from #30454. They improve the functional test framework, allowing users to run individual functional tests from the build directory in the new CMake-based build system.
This functionality is not available for out-of-source builds using the current Autotools-based build system, which always requires write permissions for the source directory. Nevertheless, this PR can be tested as suggested in #30463 (comment):
- Make an out-of-source build:
0$ ./autogen.sh
1$ mkdir ../build && cd ../build
2$ ../bitcoin/configure
3$ make
- Create a symlink in the build directory to a functional test:
0$ ln --symbolic ../../../bitcoin/test/functional/wallet_disable.py ./test/functional/
- Run this symlink:
0$ ./test/functional/wallet_disable.py
The last command fails on the master branch:
0Traceback (most recent call last):
1 File "/home/hebasto/git/build/./test/functional/wallet_disable.py", line 31, in <module>
2 DisableWalletTest().main()
3 ^^^^^^^^^^^^^^^^^^^
4 File "/home/hebasto/git/bitcoin/test/functional/test_framework/test_framework.py", line 106, in __init__
5 self.parse_args()
6 File "/home/hebasto/git/bitcoin/test/functional/test_framework/test_framework.py", line 210, in parse_args
7 config.read_file(open(self.options.configfile))
8 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9FileNotFoundError: [Errno 2] No such file or directory: '/home/hebasto/git/bitcoin/test/config.ini'
and succeeds with this PR.