diff --git a/doc/unit-tests.md b/doc/unit-tests.md --- a/doc/unit-tests.md +++ b/doc/unit-tests.md @@ -53,13 +53,13 @@ ### Note on adding test cases 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 -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 -one test file for each class or source file for which you want to create -unit tests. The file naming convention is `_tests.cpp` -and such files should wrap their tests in a test suite -called `_tests`. For an example of this pattern, +that runs all of the unit tests. The main source file for the test library +is found in `util/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 one test file for each class or source file for +which you want to create unit tests. The file naming convention is +`_tests.cpp` and such files should wrap their tests in +a test suite called `_tests`. For an example of this pattern, examine `uint256_tests.cpp`. For further reading, I found the following website to be helpful in diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -36,8 +36,8 @@ bench/base58.cpp \ bench/lockedpool.cpp \ bench/prevector.cpp \ - test/setup_common.h \ - test/setup_common.cpp \ + test/util/setup_common.h \ + test/util/setup_common.cpp \ test/util.h \ test/util.cpp diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -37,10 +37,10 @@ qt/test/wallettests.h TEST_BITCOIN_CPP = \ - test/setup_common.cpp + test/util/setup_common.cpp TEST_BITCOIN_H = \ - test/setup_common.h + test/util/setup_common.h qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ $(QT_INCLUDES) $(QT_TEST_INCLUDES) $(PROTOBUF_CFLAGS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -52,21 +52,21 @@ BITCOIN_TEST_SUITE = \ test/jsonutil.cpp \ - test/lib/blockfilter.cpp \ - test/lib/blockfilter.h \ - test/lib/logging.cpp \ - test/lib/logging.h \ - test/lib/transaction_utils.cpp \ - test/lib/transaction_utils.h \ + test/util/blockfilter.cpp \ + test/util/blockfilter.h \ + test/util/logging.cpp \ + test/util/logging.h \ + test/util/transaction_utils.cpp \ + test/util/transaction_utils.h \ test/main.cpp \ test/scriptflags.cpp \ test/sigutil.cpp \ - test/setup_common.h \ - test/setup_common.cpp + test/util/setup_common.h \ + test/util/setup_common.cpp FUZZ_SUITE = \ - test/setup_common.cpp \ - test/setup_common.h \ + test/util/setup_common.cpp \ + test/util/setup_common.h \ test/fuzz/fuzz.cpp \ test/fuzz/fuzz.h diff --git a/src/bench/CMakeLists.txt b/src/bench/CMakeLists.txt --- a/src/bench/CMakeLists.txt +++ b/src/bench/CMakeLists.txt @@ -58,7 +58,7 @@ util_time.cpp # TODO: make a test library - ../test/setup_common.cpp + ../test/util/setup_common.cpp ../test/util.cpp diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include diff --git a/src/qt/test/CMakeLists.txt b/src/qt/test/CMakeLists.txt --- a/src/qt/test/CMakeLists.txt +++ b/src/qt/test/CMakeLists.txt @@ -17,7 +17,7 @@ util.cpp # Test framework - ../../test/setup_common.cpp + ../../test/util/setup_common.cpp ) target_link_libraries(test_bitcoin-qt bitcoin-qt-base Qt5::Test) diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp --- a/src/qt/test/addressbooktests.cpp +++ b/src/qt/test/addressbooktests.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp --- a/src/qt/test/apptests.cpp +++ b/src/qt/test/apptests.cpp @@ -20,7 +20,7 @@ #include #endif -#include +#include #include diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -13,7 +13,7 @@ #include