twister: Raise exception if cmake is not found in path

Otherwise the real failure is swallowed and a TypeError exception is
raised instead.

Signed-off-by: Steven Huang <stevenhuang1995@gmail.com>
This commit is contained in:
Steven Huang 2021-03-14 01:54:40 -05:00 committed by Anas Nashif
commit 1413c55fbc

View file

@ -2061,6 +2061,10 @@ class CMake():
logger.debug("Calling cmake with arguments: {}".format(cmake_args))
cmake = shutil.which('cmake')
if not cmake:
msg = "Unable to find `cmake` in path"
logger.error(msg)
raise Exception(msg)
cmd = [cmake] + cmake_args
kwargs = dict()