diff --git a/tests/pkg_libfixmath/do-test.py b/tests/pkg_libfixmath/do-test.py index 2577a511c6..930e297097 100755 --- a/tests/pkg_libfixmath/do-test.py +++ b/tests/pkg_libfixmath/do-test.py @@ -78,12 +78,16 @@ def main(): abs_error = abs(res_locals['result'] - float(res_locals['expected'])) res_locals['result'] = '{:.4f}'.format(res_locals['result']) if abs_error > ABS_ERROR_LIMIT: - print('{}: {} != {}, {:.4f} > {}'.format(res_locals['input'], res_locals['result'], res_locals['expected'], - abs_error, ABS_ERROR_LIMIT)) + print('{}: {} != {}, {:.4f} > {}'.format( + res_locals['input'], + res_locals['result'], + res_locals['expected'], + abs_error, + ABS_ERROR_LIMIT)) errors += 1 - except: + except Exception as exc: errors += 1 - print('ERROR {}'.format(line)) + print('ERROR: {}: {}'.format(line, exc)) print('{} calculations passed.'.format(total - errors)) if errors: diff --git a/tests/pkg_libfixmath/tests/01-run.py b/tests/pkg_libfixmath/tests/01-run.py index 21e42d95fa..c68fe3b9ae 100755 --- a/tests/pkg_libfixmath/tests/01-run.py +++ b/tests/pkg_libfixmath/tests/01-run.py @@ -7,26 +7,26 @@ from testrunner import run, test_utils_interactive_sync def expect_unary(child): for _ in range(20): for op_name in ('abs', 'sq', 'atan', 'exp'): - child.expect('{}\(-?\d+\.\d+\) = -?\d+\.\d+'.format(op_name)) + child.expect(r'{}\(-?\d+\.\d+\) = -?\d+\.\d+'.format(op_name)) for _ in range(20): for op_name in ('sin', 'cos', 'tan'): - child.expect('{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name)) + child.expect(r'{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name)) for _ in range(20): for op_name in ('asin', 'acos'): - child.expect('{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name)) + child.expect(r'{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name)) for _ in range(20): for op_name in ('sqrt', 'log', 'log2', 'slog2'): - child.expect('{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name)) + child.expect(r'{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name)) def expect_binary(child): for _ in range(1500): for op_name in ('add', 'sub', 'mul', 'div', 'mod', 'sadd', 'ssub', 'smul', 'sdiv', 'min', 'max'): - child.expect('{}\(-?\d+.\d+\, -?\d+.\d+\) = -?\d+.\d+' + child.expect(r'{}\(-?\d+.\d+\, -?\d+.\d+\) = -?\d+.\d+' .format(op_name))