From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 12:59:09 +0000 (+0100) Subject: add single-arg option to fp tests X-Git-Tag: ls180-24jan2020~868 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25895686abdabd9d63342d26b19baabf936de7f9;p=ieee754fpu.git add single-arg option to fp tests --- diff --git a/src/ieee754/fpcommon/test/case_gen.py b/src/ieee754/fpcommon/test/case_gen.py index 26b6cd62..f7a6e125 100644 --- a/src/ieee754/fpcommon/test/case_gen.py +++ b/src/ieee754/fpcommon/test/case_gen.py @@ -10,11 +10,13 @@ def corner_cases(mod): mod.inf(1), mod.inf(0), mod.nan(1), mod.nan(0)] -def get_corner_cases(mod): +def get_corner_cases(mod, single_op=False): #corner cases from itertools import permutations cc = corner_cases(mod) stimulus_a = [i[0] for i in permutations(cc, 2)] + if single_op: + return stimulus_a stimulus_b = [i[1] for i in permutations(cc, 2)] return zip(stimulus_a, stimulus_b) @@ -29,59 +31,71 @@ def get_rval(width): mval = (1<