mirror of
https://github.com/pybind/pybind11.git
synced 2024-12-02 01:47:12 +00:00
Dump test output if the test runner fails
This commit is contained in:
parent
42ad328481
commit
8b5fc8b5e1
@ -46,12 +46,11 @@ name = sys.argv[1]
|
|||||||
try:
|
try:
|
||||||
output_bytes = subprocess.check_output([sys.executable, "-u", name + ".py"],
|
output_bytes = subprocess.check_output([sys.executable, "-u", name + ".py"],
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as exc:
|
||||||
if e.returncode == 99:
|
print('Test `{}` failed:\n{}\n'.format(name, '-' * 50))
|
||||||
print('Test "%s" could not be run.' % name)
|
print(exc.output.decode())
|
||||||
exit(0)
|
print('-' * 50)
|
||||||
else:
|
sys.exit(1)
|
||||||
raise
|
|
||||||
|
|
||||||
output = sanitize(output_bytes.decode('utf-8'))
|
output = sanitize(output_bytes.decode('utf-8'))
|
||||||
reference = sanitize(open(name + '.ref', 'r').read())
|
reference = sanitize(open(name + '.ref', 'r').read())
|
||||||
|
Loading…
Reference in New Issue
Block a user