Changeset View
Changeset View
Standalone View
Standalone View
doc/unit-tests.md
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | ... or to run just the doubledash test: | ||||
test_bitcoin --run_test=getarg_tests/doubledash | test_bitcoin --run_test=getarg_tests/doubledash | ||||
Run `test_bitcoin --help` for the full list. | Run `test_bitcoin --help` for the full list. | ||||
### Note on adding test cases | ### Note on adding test cases | ||||
The build system is setup to compile an executable called `test_bitcoin` | The build system is setup to compile an executable called `test_bitcoin` | ||||
that runs all of the unit tests. The main source file is called | that runs all of the unit tests. The main source file is called | ||||
test_bitcoin.cpp. To add a new unit test file to our test suite you need | setup_common.cpp. To add a new unit test file to our test suite you need | ||||
to add the file to `src/test/CMakeLists.txt`. The pattern is to create | to add the file to `src/test/CMakeLists.txt`. The pattern is to create | ||||
one test file for each class or source file for which you want to create | one test file for each class or source file for which you want to create | ||||
unit tests. The file naming convention is `<source_filename>_tests.cpp` | unit tests. The file naming convention is `<source_filename>_tests.cpp` | ||||
and such files should wrap their tests in a test suite | and such files should wrap their tests in a test suite | ||||
called `<source_filename>_tests`. For an example of this pattern, | called `<source_filename>_tests`. For an example of this pattern, | ||||
examine `uint256_tests.cpp`. | examine `uint256_tests.cpp`. | ||||
For further reading, I found the following website to be helpful in | For further reading, I found the following website to be helpful in | ||||
Show All 23 Lines |