twister: error if valgrind executable not found

if --enable-valgrind is selected but no valgrind executable can be
found in PATH, exit with an error

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
This commit is contained in:
Mikkel Jakobsen 2022-03-22 09:59:23 +01:00 committed by Anas Nashif
commit 78aa424f69
2 changed files with 5 additions and 1 deletions

View file

@ -578,7 +578,7 @@ class BinaryHandler(Handler):
command = [self.binary]
run_valgrind = False
if self.valgrind and shutil.which("valgrind"):
if self.valgrind:
command = ["valgrind", "--error-exitcode=2",
"--leak-check=full",
"--suppressions=" + ZEPHYR_BASE + "/scripts/valgrind.supp",