Skip to content

Commit

Permalink
doc: cmake: prepend and explain "build/" where needed
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 17, 2024
1 parent df3f63c commit 96f4820
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 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`
(assuming `build` is your 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
3 changes: 2 additions & 1 deletion doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ Recommendations:

Assuming the build directory is named `build`,
the documentation can be generated with `cmake --build build --target docs`.
The resulting files will be located in `build/doc/doxygen/html`;
The resulting files will be located in `build/doc/doxygen/html`
(assuming `build` is your build directory);
open `index.html` in that directory to view the homepage.

Before building the `docs` target, you'll need to install these dependencies:
Expand Down
3 changes: 2 additions & 1 deletion src/crc32c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ cmake -DCRC32C_BUILD_TESTS=0 -DCRC32C_BUILD_BENCHMARKS=0 .. && make all install

## Development

The following command (when executed from `build/`) (re)builds the project and
The following command (when executed from within your build directory,
for example,`build/`) (re)builds the project and
runs the tests.

```bash
Expand Down
4 changes: 3 additions & 1 deletion src/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ and tests weren't explicitly disabled.
Assuming the build directory is named `build`, the unit tests can be run
with `ctest --test-dir build`, which includes unit tests from subtrees.

To run the unit tests manually, launch `build/src/test/test_bitcoin`. To recompile
To run the unit tests manually, launch `build/src/test/test_bitcoin`
(assuming `build` is your build directory). To recompile
after a test file was modified, run `cmake --build build` and then run the test again. If you
modify a non-test file, use `cmake --build build --target test_bitcoin` to recompile only what's needed
to run the unit tests.
Expand All @@ -29,6 +30,7 @@ To add more unit tests, add `BOOST_AUTO_TEST_CASE` functions to the existing
implement new `BOOST_AUTO_TEST_SUITE` sections.

To run the GUI unit tests manually, launch `build/src/qt/test/test_bitcoin-qt`
(assuming `build` is your build directory).

To add more GUI unit tests, add them to the `src/qt/test/` directory and
the `src/qt/test/test_main.cpp` file.
Expand Down
6 changes: 4 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ By default, up to 4 tests will be run in parallel by test_runner. To specify
how many jobs to run, append `--jobs=n`

The individual tests and the test_runner harness have many command-line
options. Run `build/test/functional/test_runner.py -h` to see them all.
options. Run `build/test/functional/test_runner.py -h`
(assuming `build` is your build directory) to see them all.

#### Speed up test runs with a RAM disk

Expand Down Expand Up @@ -323,7 +324,8 @@ For ways to generate more granular profiles, see the README in

### Util tests

Util tests can be run locally by running `build/test/util/test_runner.py`.
Util tests can be run locally by running `build/test/util/test_runner.py`
(assuming `build` is your build directory).
Use the `-v` option for verbose output.

### Lint tests
Expand Down
4 changes: 3 additions & 1 deletion test/functional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ 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`
(assuming `build` is your build directory)
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 build directory version of this script")
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 build directory version of this script")
config.read_file(open(configfile, encoding="utf8"))

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

0 comments on commit 96f4820

Please sign in to comment.