]> Git Repo - VerusCoin.git/blame - src/test/README.md
Merge pull request #10 from jl777/dPoW
[VerusCoin.git] / src / test / README.md
CommitLineData
d3081fa2 1# Notes
8baf865c
GA
2The sources in this directory are unit test cases. Boost includes a
3unit testing framework, and since bitcoin already uses boost, it makes
4sense to simply use this framework rather than require developers to
5configure some other framework (we want as few impediments to creating
6unit tests as possible).
7
8The build system is setup to compile an executable called "test_bitcoin"
9that runs all of the unit tests. The main source file is called
10test_bitcoin.cpp, which simply includes other files that contain the
11actual unit tests (outside of a couple required preprocessor
12directives). The pattern is to create one test file for each class or
13source file for which you want to create unit tests. The file naming
14convention is "<source_filename>_tests.cpp" and such files should wrap
15their tests in a test suite called "<source_filename>_tests". For an
16examples of this pattern, examine uint160_tests.cpp and
17uint256_tests.cpp.
18
e42bf16a
EL
19Add the source files to /src/Makefile.test.include to add them to the build.
20
8baf865c
GA
21For further reading, I found the following website to be helpful in
22explaining how the boost unit test framework works:
5c27f124 23[http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/](http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/).
This page took 0.191456 seconds and 4 git commands to generate.