Skip to content

Commit

Permalink
doc: cmake: prepend "build" to functional/test_runner.py
Browse files Browse the repository at this point in the history
Also improve the error message if someone runs the functional tests
the old way (outside of the build directory).
  • Loading branch information
LarryRuane committed Sep 10, 2024
1 parent df3f63c commit 15cc656
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ and extending unit tests can be found in [/src/test/README.md](/src/test/README.

There are also [regression and integration tests](/test), written
in Python.
These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py`
These tests can be run (if the [test dependencies](/test) are installed) with: `build/test/functional/test_runner.py`.
Do not run the (identical) program `test/functional/test_runner.py` (without the build directory).

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS,
and that unit/sanity tests are run automatically.
Expand Down
2 changes: 1 addition & 1 deletion test/functional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ that file and modify to fit your needs.

#### Coverage

Running `test/functional/test_runner.py` with the `--coverage` argument tracks which RPCs are
Running `build/test/functional/test_runner.py` with the `--coverage` argument tracks which RPCs are
called by the tests and prints a report of uncovered RPCs in the summary. This
can be used (along with the `--extended` argument) to find out which RPCs we
don't have test cases for.
Expand Down
2 changes: 2 additions & 0 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ def parse_args(self, test_file):
self.options.timeout_factor = self.options.timeout_factor or (4 if self.options.valgrind else 1)
self.options.previous_releases_path = previous_releases_path

if not os.path.isfile(self.options.configfile):
raise Exception(f"config.ini file {self.options.configfile} not found, be sure to run the this script from within the build directory")
config = configparser.ConfigParser()
config.read_file(open(self.options.configfile))
self.config = config
Expand Down
2 changes: 2 additions & 0 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ def main():
# Read config generated by configure.
config = configparser.ConfigParser()
configfile = os.path.abspath(os.path.dirname(__file__)) + "/../config.ini"
if not os.path.isfile(configfile):
raise Exception(f"config.ini file {configfile} not found, be sure to run the this script from within the build directory")
config.read_file(open(configfile, encoding="utf8"))

passon_args.append("--configfile=%s" % configfile)
Expand Down

0 comments on commit 15cc656

Please sign in to comment.