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# Copyright (c) 2014-present The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or http://www.opensource.org/licenses/mit-license.php.5"""Run regression test suite.7This module calls down into individual test cases via subprocess. It will8forward all unrecognized arguments onto the individual test scripts.10For a description of arguments recognized by test scripts, see11`test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`.13"""15import argparse16from collections import deque17from concurrent import futures18import configparser19import csv20import datetime21import os22import pathlib23import platform24import time25import shutil26import signal27import subprocess28import sys29import tempfile30import re31import logging32from test_framework.util import (33Binaries,34export_env_build_path,35get_binary_paths,36)38# Minimum amount of space to run the tests.39MIN_FREE_SPACE = 1.1 * 1024 * 1024 * 102440# Additional space to run an extra job.41ADDITIONAL_SPACE_PER_JOB = 100 * 1024 * 102442# Minimum amount of space required for --nocleanup43MIN_NO_CLEANUP_SPACE = 12 * 1024 * 1024 * 102445# Formatting. Default colors to empty strings.46DEFAULT, BOLD, GREEN, RED = ("", ""), ("", ""), ("", ""), ("", "")47try:48# Make sure python thinks it can write unicode to its stdout49"\u2713".encode("utf_8").decode(sys.stdout.encoding)50TICK = "✓ "51CROSS = "✖ "52CIRCLE = "○ "53except UnicodeDecodeError:54TICK = "P "55CROSS = "x "56CIRCLE = "o "58if platform.system() == 'Windows':59import ctypes60kernel32 = ctypes.windll.kernel32 # type: ignore61ENABLE_VIRTUAL_TERMINAL_PROCESSING = 462STD_OUTPUT_HANDLE = -1163STD_ERROR_HANDLE = -1264# Enable ascii color control to stdout65stdout = kernel32.GetStdHandle(STD_OUTPUT_HANDLE)66stdout_mode = ctypes.c_int32()67kernel32.GetConsoleMode(stdout, ctypes.byref(stdout_mode))68kernel32.SetConsoleMode(stdout, stdout_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)69# Enable ascii color control to stderr70stderr = kernel32.GetStdHandle(STD_ERROR_HANDLE)71stderr_mode = ctypes.c_int32()72kernel32.GetConsoleMode(stderr, ctypes.byref(stderr_mode))73kernel32.SetConsoleMode(stderr, stderr_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)74else:75# primitive formatting on supported76# terminal via ANSI escape sequences:77DEFAULT = ('\033[0m', '\033[0m')78BOLD = ('\033[0m', '\033[1m')79GREEN = ('\033[0m', '\033[0;32m')80RED = ('\033[0m', '\033[0;31m')82TEST_EXIT_PASSED = 083TEST_EXIT_SKIPPED = 7785TEST_FRAMEWORK_UNIT_TESTS = 'feature_framework_unit_tests.py'87EXTENDED_SCRIPTS = [88# These tests are not run by default.89# Longest test should go first, to favor running tests in parallel90'feature_pruning.py',91'feature_dbcrash.py',92'feature_index_prune.py',93'feature_utxo_abort_on_error.py',94]96# Special script to run each bench sanity check97TOOL_BENCH_SANITY_CHECK = "tool_bench_sanity_check.py"99BASE_SCRIPTS = [100# Special scripts that are "expanded" later101TOOL_BENCH_SANITY_CHECK,102# Scripts that are run by default.103# Longest test should go first, to favor running tests in parallel104# vv Tests less than 5m vv105'feature_fee_estimation.py',106'feature_taproot.py',107'feature_block.py',108'mempool_ephemeral_dust.py',109'wallet_conflicts.py',110'p2p_opportunistic_1p1c.py',111'p2p_node_network_limited.py --v1transport',112'p2p_node_network_limited.py --v2transport',113# vv Tests less than 2m vv114'mining_getblocktemplate_longpoll.py',115'p2p_segwit.py',116'feature_maxuploadtarget.py',117'feature_assumeutxo.py',118'mempool_updatefromblock.py',119'mempool_persist.py',120# vv Tests less than 60s vv121'rpc_psbt.py',122'wallet_fundrawtransaction.py',123'wallet_bumpfee.py',124'wallet_v3_txs.py',125'wallet_backup.py',126'feature_segwit.py --v2transport',127'feature_segwit.py --v1transport',128'p2p_tx_download.py',129'feature_txindex_compatibility.py',130'wallet_avoidreuse.py',131'feature_abortnode.py',132'wallet_address_types.py',133'p2p_orphan_handling.py',134'wallet_basic.py',135'feature_maxtipage.py',136'wallet_multiwallet.py',137'wallet_multiwallet.py --usecli',138'p2p_dns_seeds.py',139'wallet_groups.py',140'p2p_blockfilters.py',141'feature_assumevalid.py',142'wallet_taproot.py',143'feature_bip68_sequence.py',144'rpc_packages.py',145'rpc_bind.py --ipv4',146'rpc_bind.py --ipv6',147'rpc_bind.py --nonloopback',148'p2p_headers_sync_with_minchainwork.py',149'p2p_feefilter.py',150'feature_csv_activation.py',151'p2p_sendheaders.py',152'feature_config_args.py',153'wallet_listtransactions.py',154'wallet_miniscript.py',155# vv Tests less than 30s vv156'wallet_deprecated_rbf.py',157'p2p_invalid_messages.py',158'rpc_echo_payload.py',159'rpc_createmultisig.py',160'p2p_timeouts.py --v1transport',161'p2p_timeouts.py --v2transport',162'rpc_signer.py',163'wallet_signer.py',164'mempool_limit.py',165'rpc_txoutproof.py',166'rpc_orphans.py',167'wallet_listreceivedby.py',168'wallet_abandonconflict.py',169'wallet_anchor.py',170'feature_reindex.py',171'feature_reindex_readonly.py',172'wallet_labels.py',173'p2p_compactblocks.py',174'p2p_compactblocks_blocksonly.py',175'wallet_hd.py',176'wallet_blank.py',177'wallet_keypool_topup.py',178'wallet_fast_rescan.py',179'wallet_derivehdkey.py',180'wallet_gethdkeys.py',181'wallet_createwalletdescriptor.py',182'wallet_exported_watchonly.py',183'interface_zmq.py',184'rpc_invalid_address_message.py',185'rpc_validateaddress.py',186'interface_bitcoin_cli.py',187'feature_bind_extra.py',188'mempool_resurrect.py',189'wallet_txn_doublespend.py --mineblock',190'tool_bitcoin_chainstate.py',191'tool_wallet.py',192'tool_utils.py',193'tool_signet_miner.py',194'wallet_txn_clone.py',195'wallet_txn_clone.py --segwit',196'rpc_getchaintips.py',197'rpc_misc.py',198'p2p_1p1c_network.py',199'interface_rest.py',200'mempool_spend_coinbase.py',201'wallet_avoid_mixing_output_types.py',202'mempool_reorg.py',203'p2p_block_sync.py --v1transport',204'p2p_block_sync.py --v2transport',205'wallet_createwallet.py --usecli',206'wallet_createwallet.py',207'wallet_reindex.py',208'wallet_reorgsrestore.py',209'interface_http.py',210'interface_rpc.py',211'interface_usdt_coinselection.py',212'interface_usdt_mempool.py',213'interface_usdt_net.py',214'interface_usdt_utxocache.py',215'interface_usdt_validation.py',216'rpc_users.py',217'rpc_whitelist.py',218'feature_proxy.py',219'wallet_signrawtransactionwithwallet.py',220'rpc_signrawtransactionwithkey.py',221'rpc_rawtransaction.py',222'wallet_transactiontime_rescan.py',223'p2p_addrv2_relay.py',224'p2p_compactblocks_hb.py --v1transport',225'p2p_compactblocks_hb.py --v2transport',226'p2p_disconnect_ban.py --v1transport',227'p2p_disconnect_ban.py --v2transport',228'feature_posix_fs_permissions.py',229'rpc_decodescript.py',230'rpc_blockchain.py --v1transport',231'rpc_blockchain.py --v2transport',232'mining_template_verification.py',233'rpc_deprecated.py',234'wallet_disable.py',235'wallet_change_address.py',236'p2p_addr_relay.py',237'p2p_getaddr_caching.py',238'p2p_getdata.py',239'p2p_addrfetch.py',240'rpc_net.py --v1transport',241'rpc_net.py --v2transport',242'wallet_keypool.py',243'wallet_descriptor.py',244'p2p_nobloomfilter_messages.py',245TEST_FRAMEWORK_UNIT_TESTS,246'p2p_filter.py',247'rpc_setban.py --v1transport',248'rpc_setban.py --v2transport',249'p2p_blocksonly.py',250'mining_prioritisetransaction.py',
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.