Skip to content

Commit

Permalink
fix: tests all return code
Browse files Browse the repository at this point in the history
Signed-off-by: Thing-han, Lim <[email protected]>
  • Loading branch information
potsrevennil committed Nov 11, 2024
1 parent a57490a commit 218dcf9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/lib/mlkem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,8 @@ def bench(
def all(self, func: bool, kat: bool, nistkat: bool):
config_logger(self.verbose)

exit_code = 0

def all(opt: bool):
code = 0
if self.compile:
compiles = [
*([self._func.compile] if func else []),
Expand All @@ -649,7 +648,7 @@ def all(opt: bool):
try:
f(opt)
except SystemExit as e:
exit_code = exit_code or e
code = code or e

sys.stdout.flush()

Expand All @@ -664,13 +663,16 @@ def all(opt: bool):
try:
f(opt)
except SystemExit as e:
exit_code = exit_code or e
code = code or e

sys.stdout.flush()
return code

exit_code = 0

if self.opt.lower() == "all" or self.opt.lower() == "no_opt":
all(False)
exit_code = exit_code or all(False)
if self.opt.lower() == "all" or self.opt.lower() == "opt":
all(True)
exit_code = exit_code or all(True)

exit(exit_code)

0 comments on commit 218dcf9

Please sign in to comment.