diff options
author | fanquake <fanquake@gmail.com> | 2023-06-22 12:20:25 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-06-22 12:33:35 +0100 |
commit | 2880bb588a3529c87fb6e084d8bf99c23a82403f (patch) | |
tree | b07c80fef50ac66f105205cdcffe89b7143191b9 /test | |
parent | 0c84a0e4841f00d931aa7339e9aa8f26eb2f3a61 (diff) | |
parent | 28fff06afe98177c14a932abf95b380bb51c6653 (diff) |
Merge bitcoin/bitcoin#27889: test: Kill `BOOST_ASSERT` and update the linter
28fff06afe98177c14a932abf95b380bb51c6653 test: Make linter to look for `BOOST_ASSERT` macros (Hennadii Stepanov)
47fe551e52d8b3f607d55ad20073c0436590e081 test: Kill `BOOST_ASSERT` (Hennadii Stepanov)
Pull request description:
One of the goals of https://github.com/bitcoin/bitcoin/pull/27783 was to get rid of the `BOOST_ASSERT` macros instead of including the `boost/assert.hpp` headers. See https://github.com/bitcoin/bitcoin/pull/27783#discussion_r1210612717.
It turns out that a couple of those macros sneaked into the codebase in https://github.com/bitcoin/bitcoin/pull/27790.
This PR makes the linter guard against new instances of the `BOOST_ASSERT` macros and replaces the current ones.
ACKs for top commit:
kevkevinpal:
ACK [28fff06](https://github.com/bitcoin/bitcoin/pull/27889/commits/28fff06afe98177c14a932abf95b380bb51c6653)
stickies-v:
ACK 28fff06af
TheCharlatan:
ACK 28fff06afe98177c14a932abf95b380bb51c6653
Tree-SHA512: 371f613592cf677afe0196d18c83943c6c8f1e998f57b4ff3ee58bfeff8636e4dac1357840d8611b4f7b197def94df10fe1a8ca3282b00b7b4eff4624552dda8
Diffstat (limited to 'test')
-rwxr-xr-x | test/lint/lint-assertions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lint/lint-assertions.py b/test/lint/lint-assertions.py index e7eecebce5..6da59b0d48 100755 --- a/test/lint/lint-assertions.py +++ b/test/lint/lint-assertions.py @@ -45,6 +45,16 @@ def main(): ":(exclude)src/rpc/server.cpp", ], "CHECK_NONFATAL(condition) or NONFATAL_UNREACHABLE should be used instead of assert for RPC code.") + # The `BOOST_ASSERT` macro requires to `#include boost/assert.hpp`, + # which is an unnecessary Boost dependency. + exit_code |= git_grep([ + "-E", + r"BOOST_ASSERT *\(.*\);", + "--", + "*.cpp", + "*.h", + ], "BOOST_ASSERT must be replaced with Assert, BOOST_REQUIRE, or BOOST_CHECK.") + sys.exit(exit_code) |