Browse Source

Prettier test output

default_compile_flags
vector-of-bool 5 years ago
parent
commit
fa20ca454d
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      test.py

+ 5
- 1
test.py View File





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





Loading…
Cancel
Save