|
|
@ -2,8 +2,7 @@ |
|
|
|
# Copyright (c) 2014-2016 The Bitcoin Core developers |
|
|
|
# Copyright (c) 2014-2016 The Bitcoin Core developers |
|
|
|
# Distributed under the MIT software license, see the accompanying |
|
|
|
# Distributed under the MIT software license, see the accompanying |
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
|
|
|
""" |
|
|
|
"""Run regression test suite. |
|
|
|
rpc-tests.py - run regression test suite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This module calls down into individual test cases via subprocess. It will |
|
|
|
This module calls down into individual test cases via subprocess. It will |
|
|
|
forward all unrecognized arguments onto the individual test scripts. |
|
|
|
forward all unrecognized arguments onto the individual test scripts. |
|
|
@ -11,7 +10,7 @@ forward all unrecognized arguments onto the individual test scripts. |
|
|
|
Functional tests are disabled on Windows by default. Use --force to run them anyway. |
|
|
|
Functional tests are disabled on Windows by default. Use --force to run them anyway. |
|
|
|
|
|
|
|
|
|
|
|
For a description of arguments recognized by test scripts, see |
|
|
|
For a description of arguments recognized by test scripts, see |
|
|
|
`test/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`. |
|
|
|
`test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`. |
|
|
|
|
|
|
|
|
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
@ -87,7 +86,7 @@ BASE_SCRIPTS= [ |
|
|
|
|
|
|
|
|
|
|
|
ZMQ_SCRIPTS = [ |
|
|
|
ZMQ_SCRIPTS = [ |
|
|
|
# ZMQ test can only be run if bitcoin was built with zmq-enabled. |
|
|
|
# ZMQ test can only be run if bitcoin was built with zmq-enabled. |
|
|
|
# call rpc_tests.py with -nozmq to explicitly exclude these tests. |
|
|
|
# call test_runner.py with -nozmq to explicitly exclude these tests. |
|
|
|
"zmq_test.py"] |
|
|
|
"zmq_test.py"] |
|
|
|
|
|
|
|
|
|
|
|
EXTENDED_SCRIPTS = [ |
|
|
|
EXTENDED_SCRIPTS = [ |
|
|
@ -127,7 +126,7 @@ ALL_SCRIPTS = BASE_SCRIPTS + ZMQ_SCRIPTS + EXTENDED_SCRIPTS |
|
|
|
def main(): |
|
|
|
def main(): |
|
|
|
# Parse arguments and pass through unrecognised args |
|
|
|
# Parse arguments and pass through unrecognised args |
|
|
|
parser = argparse.ArgumentParser(add_help=False, |
|
|
|
parser = argparse.ArgumentParser(add_help=False, |
|
|
|
usage='%(prog)s [rpc-test.py options] [script options] [scripts]', |
|
|
|
usage='%(prog)s [test_runner.py options] [script options] [scripts]', |
|
|
|
description=__doc__, |
|
|
|
description=__doc__, |
|
|
|
epilog=''' |
|
|
|
epilog=''' |
|
|
|
Help text and arguments for individual test script:''', |
|
|
|
Help text and arguments for individual test script:''', |
|
|
@ -147,7 +146,7 @@ def main(): |
|
|
|
|
|
|
|
|
|
|
|
# Read config generated by configure. |
|
|
|
# Read config generated by configure. |
|
|
|
config = configparser.ConfigParser() |
|
|
|
config = configparser.ConfigParser() |
|
|
|
config.read_file(open(os.path.dirname(__file__) + "/tests_config.ini")) |
|
|
|
config.read_file(open(os.path.dirname(__file__) + "/config.ini")) |
|
|
|
|
|
|
|
|
|
|
|
enable_wallet = config["components"].getboolean("ENABLE_WALLET") |
|
|
|
enable_wallet = config["components"].getboolean("ENABLE_WALLET") |
|
|
|
enable_utils = config["components"].getboolean("ENABLE_UTILS") |
|
|
|
enable_utils = config["components"].getboolean("ENABLE_UTILS") |
|
|
@ -200,11 +199,11 @@ def main(): |
|
|
|
|
|
|
|
|
|
|
|
if not test_list: |
|
|
|
if not test_list: |
|
|
|
print("No valid test scripts specified. Check that your test is in one " |
|
|
|
print("No valid test scripts specified. Check that your test is in one " |
|
|
|
"of the test lists in rpc-tests.py, or run rpc-tests.py with no arguments to run all tests") |
|
|
|
"of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests") |
|
|
|
sys.exit(0) |
|
|
|
sys.exit(0) |
|
|
|
|
|
|
|
|
|
|
|
if args.help: |
|
|
|
if args.help: |
|
|
|
# Print help for rpc-tests.py, then print help of the first script and exit. |
|
|
|
# Print help for test_runner.py, then print help of the first script and exit. |
|
|
|
parser.print_help() |
|
|
|
parser.print_help() |
|
|
|
subprocess.check_call((config["environment"]["SRCDIR"] + '/test/functional/' + test_list[0]).split() + ['-h']) |
|
|
|
subprocess.check_call((config["environment"]["SRCDIR"] + '/test/functional/' + test_list[0]).split() + ['-h']) |
|
|
|
sys.exit(0) |
|
|
|
sys.exit(0) |
|
|
@ -325,7 +324,7 @@ class TestHandler: |
|
|
|
|
|
|
|
|
|
|
|
class RPCCoverage(object): |
|
|
|
class RPCCoverage(object): |
|
|
|
""" |
|
|
|
""" |
|
|
|
Coverage reporting utilities for pull-tester. |
|
|
|
Coverage reporting utilities for test_runner. |
|
|
|
|
|
|
|
|
|
|
|
Coverage calculation works by having each test script subprocess write |
|
|
|
Coverage calculation works by having each test script subprocess write |
|
|
|
coverage files into a particular directory. These files contain the RPC |
|
|
|
coverage files into a particular directory. These files contain the RPC |