(self_test_exe, tags, rng_seed)
| 27 | return e |
| 28 | |
| 29 | def list_tests(self_test_exe, tags, rng_seed): |
| 30 | cmd = [self_test_exe, '--reporter', 'xml', '--list-tests', '--order', 'rand', |
| 31 | '--rng-seed', str(rng_seed)] |
| 32 | tags_arg = ','.join('[{}]~[.]'.format(t) for t in tags) |
| 33 | if tags_arg: |
| 34 | cmd.append(tags_arg) |
| 35 | process = subprocess.Popen( |
| 36 | cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 37 | stdout, stderr = process.communicate() |
| 38 | if stderr: |
| 39 | raise RuntimeError("Unexpected error output:\n" + process.stderr) |
| 40 | |
| 41 | root = ET.fromstring(stdout) |
| 42 | result = [(none_to_empty_str(tc.find('Name').text), |
| 43 | none_to_empty_str(tc.find('Tags').text), |
| 44 | none_to_empty_str(tc.find('ClassName').text)) for tc in root.findall('./TestCase')] |
| 45 | |
| 46 | if len(result) < 2: |
| 47 | raise RuntimeError("Unexpectedly few tests listed (got {})".format( |
| 48 | len(result))) |
| 49 | return result |
| 50 | |
| 51 | def check_is_sublist_of(shorter, longer): |
| 52 | assert len(shorter) < len(longer) |
no test coverage detected