mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
Merge 23027 via bugfix_util_test_config
This commit is contained in:
commit
159d9c36b0
@ -21,6 +21,8 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
|
|||||||
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
|
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
|
||||||
@BUILD_BITCOIN_UTIL_TRUE@ENABLE_BITCOIN_UTIL=true
|
@BUILD_BITCOIN_UTIL_TRUE@ENABLE_BITCOIN_UTIL=true
|
||||||
@BUILD_BITCOIN_WALLET_TRUE@ENABLE_WALLET_TOOL=true
|
@BUILD_BITCOIN_WALLET_TRUE@ENABLE_WALLET_TOOL=true
|
||||||
|
@BUILD_BITCOIN_TX_TRUE@ENABLE_UTIL_TX=true
|
||||||
|
@BUILD_BITCOIN_UTIL_TRUE@ENABLE_UTIL_UTIL=true
|
||||||
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
|
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
|
||||||
@ENABLE_FUZZ_BINARY_TRUE@ENABLE_FUZZ_BINARY=true
|
@ENABLE_FUZZ_BINARY_TRUE@ENABLE_FUZZ_BINARY=true
|
||||||
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true
|
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true
|
||||||
|
@ -16,6 +16,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pprint
|
import pprint
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -34,14 +35,14 @@ def main():
|
|||||||
if verbose:
|
if verbose:
|
||||||
level = logging.DEBUG
|
level = logging.DEBUG
|
||||||
else:
|
else:
|
||||||
level = logging.ERROR
|
level = logging.WARNING
|
||||||
formatter = '%(asctime)s - %(levelname)s - %(message)s'
|
formatter = '%(asctime)s - %(levelname)s - %(message)s'
|
||||||
# Add the format/level to the logger
|
# Add the format/level to the logger
|
||||||
logging.basicConfig(format=formatter, level=level)
|
logging.basicConfig(format=formatter, level=level)
|
||||||
|
|
||||||
bctester(os.path.join(env_conf["SRCDIR"], "test", "util", "data"), "bitcoin-util-test.json", env_conf)
|
bctester(os.path.join(env_conf["SRCDIR"], "test", "util", "data"), "bitcoin-util-test.json", env_conf, config['components'])
|
||||||
|
|
||||||
def bctester(testDir, input_basename, buildenv):
|
def bctester(testDir, input_basename, buildenv, component_conf):
|
||||||
""" Loads and parses the input file, runs all tests and reports results"""
|
""" Loads and parses the input file, runs all tests and reports results"""
|
||||||
input_filename = os.path.join(testDir, input_basename)
|
input_filename = os.path.join(testDir, input_basename)
|
||||||
with open(input_filename, encoding="utf8") as f:
|
with open(input_filename, encoding="utf8") as f:
|
||||||
@ -49,8 +50,17 @@ def bctester(testDir, input_basename, buildenv):
|
|||||||
input_data = json.loads(raw_data)
|
input_data = json.loads(raw_data)
|
||||||
|
|
||||||
failed_testcases = []
|
failed_testcases = []
|
||||||
|
skipped_testcases = []
|
||||||
|
skipped_testcase_deps = set()
|
||||||
|
|
||||||
for testObj in input_data:
|
for testObj in input_data:
|
||||||
|
m = re.match(r'^\.\/bitcoin-(\w+)$', testObj['exec'])
|
||||||
|
if not component_conf.getboolean(f'ENABLE_UTIL_{m.group(1).upper()}'):
|
||||||
|
logging.info("SKIPPED: " + testObj["description"])
|
||||||
|
skipped_testcases.append(testObj['description'])
|
||||||
|
skipped_testcase_deps.add(testObj['exec'])
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bctest(testDir, testObj, buildenv)
|
bctest(testDir, testObj, buildenv)
|
||||||
logging.info("PASSED: " + testObj["description"])
|
logging.info("PASSED: " + testObj["description"])
|
||||||
@ -64,6 +74,8 @@ def bctester(testDir, input_basename, buildenv):
|
|||||||
logging.error(error_message)
|
logging.error(error_message)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
|
if skipped_testcases:
|
||||||
|
logging.warning(f'{len(skipped_testcases)} tests skipped because {skipped_testcase_deps} is not built')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def bctest(testDir, testObj, buildenv):
|
def bctest(testDir, testObj, buildenv):
|
||||||
|
Loading…
Reference in New Issue
Block a user