sysgen: Terminate build when error detected

System generator now terminates with a non-zero exit code when
it detects an error, allowing the build system to detect the failure
and terminate the build.

Note: Sysgen only detects invalid keywords at this time. It would be
nice if it also detected other syntax and semantic errors.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-04-16 12:02:34 -04:00 committed by Anas Nashif
parent 5b76cee54e
commit d00b802a6d

View file

@ -136,6 +136,16 @@ def write_file(filename, contents):
f.close()
#
# ERROR HANDLING
#
def sysgen_error(msg):
print "\n*** sysgen error: " + msg + "\n"
sys.exit(1)
#
# CREATE INTERNAL REPRESENTATION OF SYSTEM
#
@ -227,8 +237,8 @@ def vpf_parse():
driver_list.append(line[start_quote + 1:end_quote])
continue
print "UNRECOGNIZED INPUT LINE"
print words # display any unrecognized line
sysgen_error("unrecognized keyword %s on following line\n%s" %
(words[0], line))
#