Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_runner.py
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393): | ||||
RED = ('\033[0m', '\033[0;31m') | RED = ('\033[0m', '\033[0;31m') | ||||
GREY = ('\033[0m', '\033[1;30m') | GREY = ('\033[0m', '\033[1;30m') | ||||
TEST_EXIT_PASSED = 0 | TEST_EXIT_PASSED = 0 | ||||
TEST_EXIT_SKIPPED = 77 | TEST_EXIT_SKIPPED = 77 | ||||
TEST_FRAMEWORK_MODULES = [ | TEST_FRAMEWORK_MODULES = [ | ||||
"address", | "address", | ||||
"blocktools", | |||||
"script", | "script", | ||||
] | ] | ||||
NON_SCRIPTS = [ | NON_SCRIPTS = [ | ||||
# These are python files that live in the functional tests directory, but | # These are python files that live in the functional tests directory, but | ||||
# are not test scripts. | # are not test scripts. | ||||
"combine_logs.py", | "combine_logs.py", | ||||
"create_cache.py", | "create_cache.py", | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | def main(): | ||||
configfile = os.path.join(os.path.abspath( | configfile = os.path.join(os.path.abspath( | ||||
os.path.dirname(__file__)), "..", "config.ini") | os.path.dirname(__file__)), "..", "config.ini") | ||||
config.read_file(open(configfile, encoding="utf8")) | config.read_file(open(configfile, encoding="utf8")) | ||||
src_dir = config["environment"]["SRCDIR"] | src_dir = config["environment"]["SRCDIR"] | ||||
build_dir = config["environment"]["BUILDDIR"] | build_dir = config["environment"]["BUILDDIR"] | ||||
tests_dir = os.path.join(src_dir, 'test', 'functional') | tests_dir = os.path.join(src_dir, 'test', 'functional') | ||||
# SRCDIR must be set for cdefs.py to find and parse consensus.h | |||||
os.environ["SRCDIR"] = src_dir | |||||
# 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 [test_runner.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:''', | ||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||||
parser.add_argument('--combinedlogslen', '-c', type=int, default=0, metavar='n', | parser.add_argument('--combinedlogslen', '-c', type=int, default=0, metavar='n', | ||||
▲ Show 20 Lines • Show All 706 Lines • Show Last 20 Lines |