From ffe95df8a1fbf3c75406725f1001e17cc585b59b Mon Sep 17 00:00:00 2001 From: Fabien Chouteau Date: Thu, 2 Jul 2020 13:29:49 +0200 Subject: [PATCH] ci-github.sh: add -E testsuite option to see error messages (#459) * ci-github.sh: add -E testsuite option to see error messages * testsuite/asserts.py: display escape sequence in expected vs actuall output --- scripts/ci-github.sh | 2 +- testsuite/drivers/alr.py | 2 +- testsuite/drivers/asserts.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ci-github.sh b/scripts/ci-github.sh index 8fb6137e..5509e3ea 100755 --- a/scripts/ci-github.sh +++ b/scripts/ci-github.sh @@ -63,7 +63,7 @@ echo Python search paths: $run_python -c "import sys; print('\n'.join(sys.path))" echo Running test suite now: -$run_python ./run.py || { echo Test suite failures, unstable build!; exit 1; } +$run_python ./run.py -E || { echo Test suite failures, unstable build!; exit 1; } cd .. echo ............................ diff --git a/testsuite/drivers/alr.py b/testsuite/drivers/alr.py index 62e81ac4..4402d27a 100644 --- a/testsuite/drivers/alr.py +++ b/testsuite/drivers/alr.py @@ -72,7 +72,7 @@ def run_alr(*args, **kwargs): print(' {}'.format(' '.join(quote_arg(arg) for arg in argv))) print('Exitted with status code {}'.format(p.status)) print('Output:') - print(p.out) + print(repr(p.out)) raise CalledProcessError('alr returned non-zero status code') # Convert CRLF line endings (Windows-style) to LF (Unix-style). This diff --git a/testsuite/drivers/asserts.py b/testsuite/drivers/asserts.py index 47219b59..feba4134 100644 --- a/testsuite/drivers/asserts.py +++ b/testsuite/drivers/asserts.py @@ -17,9 +17,9 @@ def assert_eq(expected, actual, label=None): if expected != actual: text = ['Unexpected {}:'.format(label or 'output'), 'Expecting:', - indent(str(expected)), + indent(repr(str(expected))), 'But got:', - indent(str(actual))] + indent(repr(str(actual)))] assert False, '\n'.join(text) @@ -27,7 +27,7 @@ def assert_match(expected_re, actual, label=None, flags=0): if not re.match(expected_re, actual, flags=flags): text = ['Unexpected {}'.format(label or 'output'), 'Expecting a match on:', - indent(expected_re), + indent(repr(expected_re)), 'But got:', - indent(actual)] + indent(repr(actual))] assert False, '\n'.join(text) -- 2.39.5