(self_test_exe: str, extra_args: List[str] = None)
| 67 | |
| 68 | |
| 69 | def 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 | |
| 97 | def test_sharded_listing(self_test_exe: str) -> Dict[int, List[str]]: |
no test coverage detected