Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1#!/usr/bin/env python32#3# Copyright (c) 2018-present The Bitcoin Core developers4# Distributed under the MIT software license, see the accompanying5# file COPYING or http://www.opensource.org/licenses/mit-license.php.7"""8Check the test suite naming conventions9"""11import re12import subprocess13import sys16def grep_boost_test_suites():17command = [18"git",19"grep",20"-E",21r"^(BOOST_FIXTURE_TEST_SUITE|BOOST_AUTO_TEST_SUITE)\(",22"--",23"src/ipc/test/**.cpp",24"src/test/**.cpp",25"src/wallet/test/**.cpp",26]27return subprocess.check_output(command, text=True)30def main():31test_suite_list = grep_boost_test_suites().splitlines()32not_matching = [33x34for x in test_suite_list35if re.search(r"/(.*?)\.cpp:(?:BOOST_FIXTURE_TEST_SUITE|BOOST_AUTO_TEST_SUITE)\(\1(_[a-z0-9]+)?[,)]", x) is None36]37if len(not_matching) > 0:38not_matching = "\n".join(not_matching)39error_msg = (40"The test suite in file src/test/foo_tests.cpp should be named\n"41'`foo_tests`, or if there are multiple test suites, `foo_tests_bar`.\n'42'Please make sure the following test suites follow that convention:\n\n'43f"{not_matching}\n"44)45print(error_msg)46sys.exit(1)49if __name__ == "__main__":50main()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.