Skip to content

Commit a7d17da

Browse files
committed
Merge bitcoin/bitcoin#22086: test: remove BasicTestingSetup from unit tests that don't need it
6c3fcd5 test: remove BasicTestingSetup from util_threadnames unit tests (fanquake) b53d3c1 test: remove BasicTestingSetup from uint256 unit tests (fanquake) c0497a4 test: remove BasicTestingSetup from torcontrol unit tests (fanquake) ef8bb04 test: remove BasicTestingSetup from sync unit tests (fanquake) 1aee834 test: remove BasicTestingSetup from reverse_lock unit tests (fanquake) 57ba949 test: remove BasicTestingSetup from policy_fee unit tests (fanquake) 3974c96 test: remove BasicTestingSetup from merkleblock tests (fanquake) cd5bc4b test: remove BasicTestingSetup from hash unit tests (fanquake) 39cec22 test: remove BasicTestingSetup from compilerbug unit tests (fanquake) 6d3b78c test: remove BasicTestingSetup from bswap unit tests (fanquake) a13dc24 test: remove BasicTestingSetup from bech32 unit tests (fanquake) f4dcbe4 test: remove BasicTestingSetup from base64 unit tests (fanquake) fd144f6 test: remove BasicTestingSetup from base32 unit tests (fanquake) 4c389ba test: remove BasicTestingSetup from arith_uint256 unit tests (fanquake) 0559065 test: remove BasicTestingSetup from amount unit tests (fanquake) 883a5c7 test: remove BasicTestingSetup from allocator unit tests (fanquake) Pull request description: * Less setup/overhead for tests that don't need it. Some naive bench-marking would suggest that a full `test_bitcoin` run is a few % faster after this change. * Tests which don't need the BasicTestingSetup can't accidentally end up depending on it somehow. * Already the case in at least the scheduler and block_filter tests. This adds missing includes, but more significant is the removal of `setup_common.h` from tests where it isn't needed. This saves recompiling those tests when changes are made in the header. ACKs for top commit: practicalswift: cr ACK 6c3fcd5: patch looks correct laanwj: ACK 6c3fcd5 Tree-SHA512: 69b891e2b4740402d62b86a4fc98c329a432d125971342a6f97334e166b3537ed3d4cdbb2531fa05c1feae32339c9fcb2dceda9afeeaed4edc70e8caa0962161
2 parents e3d644a + 6c3fcd5 commit a7d17da

16 files changed

+36
-30
lines changed

src/test/allocator_tests.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#include <support/lockedpool.h>
56
#include <util/system.h>
67

7-
#include <test/util/setup_common.h>
8-
8+
#include <limits>
99
#include <memory>
10+
#include <stdexcept>
11+
#include <utility>
12+
#include <vector>
1013

1114
#include <boost/test/unit_test.hpp>
1215

13-
BOOST_FIXTURE_TEST_SUITE(allocator_tests, BasicTestingSetup)
16+
BOOST_AUTO_TEST_SUITE(allocator_tests)
1417

1518
BOOST_AUTO_TEST_CASE(arena_tests)
1619
{

src/test/amount_tests.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
#include <amount.h>
66
#include <policy/feerate.h>
7-
#include <test/util/setup_common.h>
7+
8+
#include <limits>
89

910
#include <boost/test/unit_test.hpp>
1011

11-
BOOST_FIXTURE_TEST_SUITE(amount_tests, BasicTestingSetup)
12+
BOOST_AUTO_TEST_SUITE(amount_tests)
1213

1314
BOOST_AUTO_TEST_CASE(MoneyRangeTest)
1415
{

src/test/arith_uint256_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <arith_uint256.h>
6-
#include <test/util/setup_common.h>
76
#include <uint256.h>
87

98
#include <boost/test/unit_test.hpp>
109

1110
#include <cmath>
11+
#include <cstdint>
1212
#include <iomanip>
1313
#include <limits>
1414
#include <sstream>
15-
#include <stdint.h>
1615
#include <string>
16+
#include <vector>
1717

18-
BOOST_FIXTURE_TEST_SUITE(arith_uint256_tests, BasicTestingSetup)
18+
BOOST_AUTO_TEST_SUITE(arith_uint256_tests)
1919

2020
/// Convert vector to arith_uint256, via uint256 blob
2121
static inline arith_uint256 arith_uint256V(const std::vector<unsigned char>& vch)

src/test/base32_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <test/util/setup_common.h>
65
#include <util/strencodings.h>
76

87
#include <boost/test/unit_test.hpp>
98
#include <string>
109

1110
using namespace std::literals;
1211

13-
BOOST_FIXTURE_TEST_SUITE(base32_tests, BasicTestingSetup)
12+
BOOST_AUTO_TEST_SUITE(base32_tests)
1413

1514
BOOST_AUTO_TEST_CASE(base32_testvectors)
1615
{

src/test/base64_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <test/util/setup_common.h>
65
#include <util/strencodings.h>
76

87
#include <boost/test/unit_test.hpp>
98
#include <string>
109

1110
using namespace std::literals;
1211

13-
BOOST_FIXTURE_TEST_SUITE(base64_tests, BasicTestingSetup)
12+
BOOST_AUTO_TEST_SUITE(base64_tests)
1413

1514
BOOST_AUTO_TEST_CASE(base64_testvectors)
1615
{

src/test/bech32_tests.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <bech32.h>
6-
#include <test/util/setup_common.h>
76
#include <test/util/str.h>
87

98
#include <boost/test/unit_test.hpp>
109

11-
BOOST_FIXTURE_TEST_SUITE(bech32_tests, BasicTestingSetup)
10+
#include <string>
11+
12+
BOOST_AUTO_TEST_SUITE(bech32_tests)
1213

1314
BOOST_AUTO_TEST_CASE(bech32_testvectors_valid)
1415
{

src/test/bswap_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <compat/byteswap.h>
6-
#include <test/util/setup_common.h>
76

87
#include <boost/test/unit_test.hpp>
98

10-
BOOST_FIXTURE_TEST_SUITE(bswap_tests, BasicTestingSetup)
9+
BOOST_AUTO_TEST_SUITE(bswap_tests)
1110

1211
BOOST_AUTO_TEST_CASE(bswap_tests)
1312
{

src/test/compilerbug_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <boost/test/unit_test.hpp>
6-
#include <test/util/setup_common.h>
76

8-
BOOST_FIXTURE_TEST_SUITE(compilerbug_tests, BasicTestingSetup)
7+
BOOST_AUTO_TEST_SUITE(compilerbug_tests)
98

109
#if defined(__GNUC__)
1110
// This block will also be built under clang, which is fine (as it supports noinline)

src/test/hash_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <boost/test/unit_test.hpp>
1212

13-
BOOST_FIXTURE_TEST_SUITE(hash_tests, BasicTestingSetup)
13+
BOOST_AUTO_TEST_SUITE(hash_tests)
1414

1515
BOOST_AUTO_TEST_CASE(murmurhash3)
1616
{

src/test/merkleblock_tests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99
#include <boost/test/unit_test.hpp>
1010

11+
#include <set>
12+
#include <vector>
1113

12-
BOOST_FIXTURE_TEST_SUITE(merkleblock_tests, BasicTestingSetup)
14+
BOOST_AUTO_TEST_SUITE(merkleblock_tests)
1315

1416
/**
1517
* Create a CMerkleBlock using a list of txids which will be found in the

0 commit comments

Comments
 (0)