From 3aadcd46bc85a8fa8ee7547a1c40f7629d9da233 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sat, 4 Jan 2025 05:37:11 +0000 Subject: [PATCH] Tests: Fix detection of cross_prefix argument The `--cross-prefix` argument for the `tests` script defaults to `""`, not `None`. This led to the `mlkem_test.py` script incorrectly printing `Cross` to the github log where it should have printed `Native`. This commit fixes this. Signed-off-by: Hanno Becker --- scripts/lib/mlkem_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lib/mlkem_test.py b/scripts/lib/mlkem_test.py index 90a4f41f2..daaf977b9 100644 --- a/scripts/lib/mlkem_test.py +++ b/scripts/lib/mlkem_test.py @@ -61,7 +61,7 @@ def do_no_opt(self): return self.args.opt.lower() in ["all", "no_opt"] def compile_mode(self): - return "Cross" if self.args.cross_prefix is not None else "Native" + return "Cross" if self.args.cross_prefix != "" else "Native" def _compile_schemes(self, test_type, opt): """compile or cross compile with some extra environment variables and makefile arguments""" @@ -84,7 +84,7 @@ def _compile_schemes(self, test_type, opt): env_update = {} if self.args.cflags is not None and self.args.cflags != "": env_update["CFLAGS"] = self.args.cflags - if self.args.cross_prefix is not None and self.args.cross_prefix != "": + if self.args.cross_prefix != "": env_update["CROSS_PREFIX"] = self.args.cross_prefix env = os.environ.copy()