From: Dylan Baker <[email protected]> These warnings are expected, it's better to hide expected warnings and provide a comment about them being expected than to have them clutter the output of the build system.
Signed-off-by: Dylan Baker <[email protected]> --- The fact that these are expected is based off of a comment Paul Berry made to me in the past, not of my personal knowledge of the generators. Since he wrote this module I expect that he knew what he was talking about. generated_tests/builtin_function.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/generated_tests/builtin_function.py b/generated_tests/builtin_function.py index 2b69c49..40ef70f 100644 --- a/generated_tests/builtin_function.py +++ b/generated_tests/builtin_function.py @@ -52,6 +52,7 @@ from __future__ import print_function, division, absolute_import import collections import itertools import functools +import warnings from six.moves import range import numpy as np @@ -1279,10 +1280,13 @@ def _make_vector_or_matrix_test_vectors(test_suite_dict): [floats+vecs+mats+ints+ivecs+uints+uvecs, floats+vecs+mats+ints+ivecs+uints+uvecs], template='{0};\n result += {1}') - f('op-assign-sub', 2, 110, lambda x, y: x - y, match_assignment_operators, - [floats+vecs+mats+ints+ivecs+uints+uvecs, - floats+vecs+mats+ints+ivecs+uints+uvecs], - template='{0};\n result -= {1}') + # This can generate an overflow warning, this is expected + with warnings.catch_warnings(RuntimeWarning): + f('op-assign-sub', 2, 110, + lambda x, y: x - y, match_assignment_operators, + [floats+vecs+mats+ints+ivecs+uints+uvecs, + floats+vecs+mats+ints+ivecs+uints+uvecs], + template='{0};\n result -= {1}') f('op-assign-mult', 2, 110, _multiply, match_assignment_multiply, [floats+vecs+mats+ints+ivecs+uints+uvecs, floats+vecs+mats+ints+ivecs+uints+uvecs], @@ -1321,10 +1325,12 @@ def _make_vector_or_matrix_test_vectors(test_suite_dict): [floats+vecs+mats+ints+ivecs+uints+uvecs, floats+vecs+mats+ints+ivecs+uints+uvecs], template='({0} + {1})') - f('op-sub', 2, 110, lambda x, y: x - y, match_simple_binop, - [floats+vecs+mats+ints+ivecs+uints+uvecs, - floats+vecs+mats+ints+ivecs+uints+uvecs], - template='({0} - {1})') + # This can generate an overflow warning, this is expected + with warnings.catch_warnings(RuntimeWarning): + f('op-sub', 2, 110, lambda x, y: x - y, match_simple_binop, + [floats+vecs+mats+ints+ivecs+uints+uvecs, + floats+vecs+mats+ints+ivecs+uints+uvecs], + template='({0} - {1})') f('op-mult', 2, 110, _multiply, match_multiply, [floats+vecs+mats+ints+ivecs+uints+uvecs, floats+vecs+mats+ints+ivecs+uints+uvecs], -- 2.6.2 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
