From 5769966d0f9471c9715ab7c2a12044065b1b77e8 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 9 Jan 2025 21:37:42 -0500 Subject: [PATCH] twister: deal with variants set on command line not force host variant if environment is setting something different in the case of posix arch. Fixes #83766 Signed-off-by: Anas Nashif --- scripts/pylib/twister/twisterlib/testplan.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index 7c29df275eb..5d17f5cc546 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -898,9 +898,14 @@ def apply_filters(self, **kwargs): ): if itoolchain: toolchain = itoolchain + elif plat.arch in ['posix', 'unit']: + # workaround until toolchain variant in zephyr is overhauled and improved. + if self.env.toolchain in ['llvm']: + toolchain = 'llvm' + else: + toolchain = 'host' else: - default_toolchain = "zephyr" if not self.env.toolchain else self.env.toolchain - toolchain = default_toolchain if plat.arch not in ['posix', 'unit'] else "host" + toolchain = "zephyr" if not self.env.toolchain else self.env.toolchain instance = TestInstance(ts, plat, toolchain, self.env.outdir) instance.run = instance.check_runnable(