1
- # Notes
1
+ ### Compiling/running unit tests
2
+
3
+ Unit tests will be automatically compiled if dependencies were met in ` ./configure `
4
+ and tests weren't explicitly disabled.
5
+
6
+ After configuring, they can be run with ` make check ` .
7
+
8
+ To run the bitcoind tests manually, launch ` src/test/test_bitcoin ` .
9
+
10
+ To add more bitcoind tests, add ` BOOST_AUTO_TEST_CASE ` functions to the existing
11
+ .cpp files in the ` test/ ` directory or add new .cpp files that
12
+ implement new BOOST_AUTO_TEST_SUITE sections.
13
+
14
+ To run the bitcoin-qt tests manually, launch ` src/qt/test/test_bitcoin-qt `
15
+
16
+ To add more bitcoin-qt tests, add them to the ` src/qt/test/ ` directory and
17
+ the ` src/qt/test/test_main.cpp ` file.
18
+
19
+ ### Running individual tests
20
+
21
+ test_bitcoin has some built-in command-line arguments; for
22
+ example, to run just the getarg_tests verbosely:
23
+
24
+ test_bitcoin --log_level=all --run_test=getarg_tests
25
+
26
+ ... or to run just the doubledash test:
27
+
28
+ test_bitcoin --run_test=getarg_tests/doubledash
29
+
30
+ Run ` test_bitcoin --help ` for the full list.
31
+
32
+ ### Note on adding test cases
33
+
2
34
The sources in this directory are unit test cases. Boost includes a
3
35
unit testing framework, and since bitcoin already uses boost, it makes
4
36
sense to simply use this framework rather than require developers to
@@ -19,22 +51,11 @@ For further reading, I found the following website to be helpful in
19
51
explaining how the boost unit test framework works:
20
52
[ http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/ ] ( http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/ ) .
21
53
22
- test_bitcoin has some built-in command-line arguments; for
23
- example, to run just the getarg_tests verbosely:
24
-
25
- test_bitcoin --log_level=all --run_test=getarg_tests
26
-
27
- ... or to run just the doubledash test:
28
-
29
- test_bitcoin --run_test=getarg_tests/doubledash
30
-
31
- Run ` test_bitcoin --help ` for the full list.
32
-
33
54
### bitcoin-util-test.py
34
55
35
56
The test directory also contains the bitcoin-util-test.py tool, which tests bitcoin utils (currently just bitcoin-tx). This test gets run automatically during the ` make check ` build process. It is also possible to run the test manually from the src directory:
36
57
37
58
```
38
59
test/bitcoin-util-test.py --srcdir=[current directory]
39
60
40
- ```
61
+ ```
0 commit comments