MCPcopy Create free account
hub / github.com/catchorg/Catch2 / execute_tests

Function execute_tests

tests/TestScripts/testSharding.py:69–94  ·  view source on GitHub ↗
(self_test_exe: str, extra_args: List[str] = None)

Source from the content-addressed store, hash-verified

67
68
69def execute_tests(self_test_exe: str, extra_args: List[str] = None):
70 cmd = make_base_commandline(self_test_exe)
71 if extra_args:
72 cmd.extend(extra_args)
73
74 try:
75 ret = subprocess.run(cmd,
76 stdout = subprocess.PIPE,
77 stderr = subprocess.PIPE,
78 timeout = 10,
79 check = True,
80 universal_newlines = True)
81 except subprocess.CalledProcessError as ex:
82 print('Could not list tests:\n{}'.format(ex.stderr))
83
84 if ret.stderr:
85 raise RuntimeError("Unexpected error output:\n" + process.stderr)
86
87 root = ET.fromstring(ret.stdout)
88 result = [elem.attrib["name"] for elem in root.findall('./TestCase')]
89
90 if len(result) < 2:
91 raise RuntimeError("Unexpectedly few tests listed (got {})".format(
92 len(result)))
93
94 return result
95
96
97def test_sharded_listing(self_test_exe: str) -> Dict[int, List[str]]:

Callers 1

test_sharded_executionFunction · 0.85

Calls 3

make_base_commandlineFunction · 0.85
printFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected