aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-03-27 11:33:00 -0400
committerJohn Newbery <john@johnnewbery.com>2017-03-27 11:33:00 -0400
commit29d6634a691044cb5d87173c029c8da309c0102e (patch)
treede38d110b45fd74b79f63eef4ef6e6f8bb1a2f10 /test
parent5114f8113627791b871c88998bd5a3d36961c241 (diff)
Check that all test scripts in test/functional are being run
This commit checks that all of the python files in the test/functional directory are listed in test_runner.py.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/test_runner.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index e8d8908b13..9eab9c7917 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -127,6 +127,13 @@ EXTENDED_SCRIPTS = [
ALL_SCRIPTS = BASE_SCRIPTS + ZMQ_SCRIPTS + EXTENDED_SCRIPTS
+NON_SCRIPTS = [
+ # These are python files that live in the functional tests directory, but are not test scripts.
+ "combine_logs.py",
+ "create_cache.py",
+ "test_runner.py",
+]
+
def main():
# Parse arguments and pass through unrecognised args
parser = argparse.ArgumentParser(add_help=False,
@@ -212,6 +219,8 @@ def main():
subprocess.check_call([(config["environment"]["SRCDIR"] + '/test/functional/' + test_list[0].split()[0])] + ['-h'])
sys.exit(0)
+ check_script_list(config["environment"]["SRCDIR"])
+
run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args)
def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=False, args=[]):
@@ -331,6 +340,18 @@ class TestHandler:
return name, stdout, stderr, status, int(time.time() - time0)
print('.', end='', flush=True)
+def check_script_list(src_dir):
+ """Check scripts directory.
+
+ Check that there are no scripts in the functional tests directory which are
+ not being run by pull-tester.py."""
+ script_dir = src_dir + '/test/functional/'
+ python_files = set([t for t in os.listdir(script_dir) if t[-3:] == ".py"])
+ missed_tests = list(python_files - set(map(lambda x: x.split()[0], ALL_SCRIPTS + NON_SCRIPTS)))
+ if len(missed_tests) != 0:
+ print("The following scripts are not being run:" + str(missed_tests))
+ print("Check the test lists in test_runner.py")
+ sys.exit(1)
class RPCCoverage(object):
"""