Skip to content

Commit 0024d2c

Browse files
committed
doc: unit test runner documentation improvements
including hoisting the `test_bitcoin --help` sentence to the beginning of the section, where it is probably the most useful.
1 parent 03c48f9 commit 0024d2c

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

src/test/README.md

+24-15
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,45 @@ the `src/qt/test/test_main.cpp` file.
3535

3636
### Running individual tests
3737

38-
`test_bitcoin` accepts the command line arguments from the boost framework.
39-
For example, to run just the `getarg_tests` suite of tests:
38+
The `test_bitcoin` runner accepts command line arguments from the Boost
39+
framework. To see the list of arguments that may be passed, run:
40+
41+
```
42+
test_bitcoin --help
43+
```
44+
45+
For example, to run only the tests in the `getarg_tests` file, with full logging:
4046

4147
```bash
4248
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests
4349
```
4450

45-
`log_level` controls the verbosity of the test framework, which logs when a
46-
test case is entered, for example.
51+
or
4752

48-
`test_bitcoin` also accepts some of the command line arguments accepted by
49-
`bitcoind`. Use `--` to separate these sets of arguments:
53+
```bash
54+
build/src/test/test_bitcoin -l all -t getarg_tests
55+
```
56+
57+
or to run only the doubledash test in `getarg_tests`
5058

5159
```bash
52-
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests -- -printtoconsole=1
60+
build/src/test/test_bitcoin --run_test=getarg_tests/doubledash
5361
```
5462

55-
The `-printtoconsole=1` after the two dashes sends debug logging, which
56-
normally goes only to `debug.log` within the data directory, also to the
57-
standard terminal output.
63+
The `--log_level=` (or `-l`) argument controls the verbosity of the test output.
5864

59-
... or to run just the doubledash test:
65+
The `test_bitcoin` runner also accepts some of the command line arguments accepted by
66+
`bitcoind`. Use `--` to separate these sets of arguments:
6067

6168
```bash
62-
build/src/test/test_bitcoin --run_test=getarg_tests/doubledash
69+
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests -- -printtoconsole=1
6370
```
6471

65-
`test_bitcoin` creates a temporary working (data) directory with a randomly
72+
The `-printtoconsole=1` after the two dashes sends debug logging, which
73+
normally goes only to `debug.log` within the data directory, to the
74+
standard terminal output as well.
75+
76+
Running `test_bitcoin` creates a temporary working (data) directory with a randomly
6677
generated pathname within `test_common bitcoin/`, which in turn is within
6778
the system's temporary directory (see
6879
[`temp_directory_path`](https://en.cppreference.com/w/cpp/filesystem/temp_directory_path)).
@@ -97,8 +108,6 @@ If you run an entire test suite, such as `--run_test=getarg_tests`, or all the t
97108
(by not specifying `--run_test`), a separate directory
98109
will be created for each individual test.
99110

100-
Run `test_bitcoin --help` for the full list of arguments that can be passed.
101-
102111
### Adding test cases
103112

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

0 commit comments

Comments
 (0)