sanitycheck: catch build failures

CMake is not returning any error codes on build failures so those go
undetected in some cases. Handle the case where we get no output at all
from cmake and deal with that as a failure.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-03-28 08:42:25 -04:00 committed by Carles Cufí
commit 6667dc35e7

View file

@ -1831,8 +1831,8 @@ class CMake():
log_msg = out.decode(sys.getdefaultencoding())
with open(os.path.join(self.build_dir, self.log), "a") as log:
log.write(log_msg)
else:
logger.debug("Build failed")
return None
else:
# A real error occurred, raise an exception
@ -2105,6 +2105,11 @@ class ProjectBuilder(FilterBuilder):
logger.debug("build test: %s" % self.instance.name)
results = self.build()
if not results:
self.instance.status = "failed"
self.instance.reason = "Build Failure"
pipeline.put({"op": "report", "test": self.instance})
else:
if results.get('returncode', 1) > 0:
pipeline.put({"op": "report", "test": self.instance})
else: