Skip to content

Commit

Permalink
doc: unit test runner documentation improvements
Browse files Browse the repository at this point in the history
including hoisting the `test_bitcoin --help` sentence to the beginning of the
section, where it is probably the most useful.
  • Loading branch information
jonatack committed Sep 12, 2024
1 parent 03c48f9 commit cde0f77
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,23 @@ the `src/qt/test/test_main.cpp` file.

### Running individual tests

`test_bitcoin` accepts the command line arguments from the boost framework.
For example, to run just the `getarg_tests` suite of tests:
The `test_bitcoin` runner accepts command line arguments from the Boost framework.

Run `test_bitcoin --help` for the full list of arguments that may be passed.

For example, to run only the tests in the `getarg_tests` file with full logging:

```bash
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests
```

`log_level` controls the verbosity of the test framework, which logs when a
test case is entered, for example.
or

```bash
build/src/test/test_bitcoin -l all -t getarg_tests
```

The `--log_level=` (or `-l`) argument controls the verbosity of the test output.

`test_bitcoin` also accepts some of the command line arguments accepted by
`bitcoind`. Use `--` to separate these sets of arguments:
Expand All @@ -62,7 +70,7 @@ standard terminal output.
build/src/test/test_bitcoin --run_test=getarg_tests/doubledash
```

`test_bitcoin` creates a temporary working (data) directory with a randomly
Running `test_bitcoin` creates a temporary working (data) directory with a randomly
generated pathname within `test_common bitcoin/`, which in turn is within
the system's temporary directory (see
[`temp_directory_path`](https://en.cppreference.com/w/cpp/filesystem/temp_directory_path)).
Expand Down Expand Up @@ -97,8 +105,6 @@ If you run an entire test suite, such as `--run_test=getarg_tests`, or all the t
(by not specifying `--run_test`), a separate directory
will be created for each individual test.

Run `test_bitcoin --help` for the full list of arguments that can be passed.

### Adding test cases

To add a new unit test file to our test suite, you need
Expand Down

0 comments on commit cde0f77

Please sign in to comment.