| def run_test_dir(dir: Path, opts: TestOptions) -> bool: | def run_test_dir(dir: Path, opts: TestOptions) -> bool: | ||||
| print(f'Running test: {dir.name} ...') | |||||
| print(f'Running test: {dir.name} ', end='') | |||||
| out_dir = dir / '_build' | out_dir = dir / '_build' | ||||
| if out_dir.exists(): | if out_dir.exists(): | ||||
| shutil.rmtree(out_dir) | shutil.rmtree(out_dir) | ||||
| '--tests', | '--tests', | ||||
| f'--toolchain={opts.toolchain}', | f'--toolchain={opts.toolchain}', | ||||
| f'--out-dir={out_dir}', | f'--out-dir={out_dir}', | ||||
| f'--export-name={dir.stem}', | |||||
| ], | ], | ||||
| cwd=dir, | cwd=dir, | ||||
| stdout=subprocess.PIPE, | stdout=subprocess.PIPE, | ||||
| stderr=subprocess.STDOUT, | stderr=subprocess.STDOUT, | ||||
| ) | ) | ||||
| if res.returncode != 0: | if res.returncode != 0: | ||||
| print('- FAILED') | |||||
| print(f'Test failed with exit code [{res.returncode}]:\n{res.stdout.decode()}') | print(f'Test failed with exit code [{res.returncode}]:\n{res.stdout.decode()}') | ||||
| else: | |||||
| print('- PASSED') | |||||
| return res.returncode == 0 | return res.returncode == 0 | ||||