twister: Look at SIMICS_PROJECT environment variable to find simics

While cmake/emu/simics.cmake uses SIMICS_PROJECT env var, twister checks
if a build is "runnable" by checking if `simics` is executable, but it
doesn't look at SIMICS_PROJECT env var.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
This commit is contained in:
Ederson de Souza 2025-04-08 09:37:34 -07:00 committed by Benjamin Cabé
commit 01d10a4115

View file

@ -30,6 +30,9 @@ class Simulator:
self.exec = data.get("exec") self.exec = data.get("exec")
def is_runnable(self) -> bool: def is_runnable(self) -> bool:
if self.name == "simics":
return shutil.which(self.exec, path=os.environ.get("SIMICS_PROJECT")) is not None
return not bool(self.exec) or bool(shutil.which(self.exec)) return not bool(self.exec) or bool(shutil.which(self.exec))
def __str__(self): def __str__(self):