Skip to content

Commit

Permalink
case.build needs to check success in order to return a sane error code
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfouca committed Aug 11, 2016
1 parent df432e8 commit bf941ed
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions scripts/Tools/case.build
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def _main_func(description):
caseroot, sharedlib_only, model_only, cleanlist = parse_command_line(sys.argv, description)
logging.info("calling build.case_build with caseroot=%s" %caseroot)

success = True
with Case(caseroot, read_only=False) as case:
testname = case.get_value('TESTCASE')

Expand All @@ -88,16 +89,20 @@ def _main_func(description):

append_status("case.testbuild starting ",
caseroot=caseroot,sfile="CaseStatus")
test.build(sharedlib_only=sharedlib_only, model_only=model_only)
append_status("case.testbuild complete",
caseroot=caseroot,sfile="CaseStatus")
success = test.build(sharedlib_only=sharedlib_only, model_only=model_only)
if success:
append_status("case.testbuild complete",
caseroot=caseroot,sfile="CaseStatus")
else:
append_status("case.build starting",
caseroot=caseroot,sfile="CaseStatus")
build.case_build(caseroot, case=case, sharedlib_only=sharedlib_only,
success = build.case_build(caseroot, case=case, sharedlib_only=sharedlib_only,
model_only=model_only)
append_status("case.build complete",
caseroot=caseroot,sfile="CaseStatus")
if success:
append_status("case.build complete",
caseroot=caseroot,sfile="CaseStatus")

sys.exit(0 if success else 1)

if __name__ == "__main__":
_main_func(__doc__)

0 comments on commit bf941ed

Please sign in to comment.