-
+ 4B87B83C415AA00E319AC929F7C41302D5D7236C2FD9AB74C284E54C9A9377CBD3D326D2C8AAB33F17F6450B89A15E82D634C72CFAB185687E6E0DF55545509Cbitcoin/src/test/README(0 . 0)(1 . 21)
21208 The sources in this directory are unit test cases. Boost includes a
21209 unit testing framework, and since bitcoin already uses boost, it makes
21210 sense to simply use this framework rather than require developers to
21211 configure some other framework (we want as few impediments to creating
21212 unit tests as possible).
21213
21214 The build system is setup to compile an executable called "test_bitcoin"
21215 that runs all of the unit tests. The main source file is called
21216 test_bitcoin.cpp, which simply includes other files that contain the
21217 actual unit tests (outside of a couple required preprocessor
21218 directives). The pattern is to create one test file for each class or
21219 source file for which you want to create unit tests. The file naming
21220 convention is "<source_filename>_tests.cpp" and such files should wrap
21221 their tests in a test suite called "<source_filename>_tests". For an
21222 examples of this pattern, examine uint160_tests.cpp and
21223 uint256_tests.cpp.
21224
21225 For further reading, I found the following website to be helpful in
21226 explaining how the boost unit test framework works:
21227
21228 http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/