Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_runner.py
Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | for test in TEST_PARAMS: | ||||
"not been renamed or deleted".format(test)) | "not been renamed or deleted".format(test)) | ||||
sys.exit(1) | sys.exit(1) | ||||
if tests: | if tests: | ||||
# Individual tests have been specified. Run specified tests that exist | # Individual tests have been specified. Run specified tests that exist | ||||
# in the all_scripts list. Accept the name with or without .py | # in the all_scripts list. Accept the name with or without .py | ||||
# extension. | # extension. | ||||
individual_tests = [ | individual_tests = [ | ||||
re.sub("\.py$", "", t) + ".py" for t in tests if not t.endswith('*')] | re.sub(r"\.py$", "", t) + ".py" for t in tests if not t.endswith('*')] | ||||
test_list = [] | test_list = [] | ||||
for t in individual_tests: | for t in individual_tests: | ||||
if t in all_scripts: | if t in all_scripts: | ||||
test_list.append(t) | test_list.append(t) | ||||
else: | else: | ||||
print("{}WARNING!{} Test '{}' not found in full test list.".format( | print("{}WARNING!{} Test '{}' not found in full test list.".format( | ||||
BOLD[1], BOLD[0], t)) | BOLD[1], BOLD[0], t)) | ||||
Show All 11 Lines | else: | ||||
# Run all tests that do not exceed | # Run all tests that do not exceed | ||||
test_list = all_scripts | test_list = all_scripts | ||||
cutoff = args.cutoff | cutoff = args.cutoff | ||||
if args.extended: | if args.extended: | ||||
cutoff = sys.maxsize | cutoff = sys.maxsize | ||||
# Remove the test cases that the user has explicitly asked to exclude. | # Remove the test cases that the user has explicitly asked to exclude. | ||||
if args.exclude: | if args.exclude: | ||||
tests_excl = [re.sub("\.py$", "", t) + | tests_excl = [re.sub(r"\.py$", "", t) + | ||||
".py" for t in args.exclude.split(',')] | ".py" for t in args.exclude.split(',')] | ||||
for exclude_test in tests_excl: | for exclude_test in tests_excl: | ||||
if exclude_test in test_list: | if exclude_test in test_list: | ||||
test_list.remove(exclude_test) | test_list.remove(exclude_test) | ||||
else: | else: | ||||
print("{}WARNING!{} Test '{}' not found in current test list.".format( | print("{}WARNING!{} Test '{}' not found in current test list.".format( | ||||
BOLD[1], BOLD[0], exclude_test)) | BOLD[1], BOLD[0], exclude_test)) | ||||
▲ Show 20 Lines • Show All 488 Lines • Show Last 20 Lines |