Skip to content

Commit

Permalink
Python returns non-zero code on error
Browse files Browse the repository at this point in the history
If bld_lib.py or bld_exe.py fails, then marbl_testing_class.py returns a status
of 1. (Similarly, if one of the stand-alone tests fail, the python returns 1).
  • Loading branch information
mnlevy1981 committed Jun 14, 2018
1 parent d2bfa5a commit 3e35491
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/python_for_tests/marbl_testing_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ def build_lib(self, loc_compiler=None):
makecmd = 'make %s' % loc_compiler
if self._mpitasks > 0:
makecmd += ' USEMPI=TRUE'
sh_command('cd %s; %s' % (src_dir, makecmd))
status_code = sh_command('cd %s; %s' % (src_dir, makecmd))
if status_code != 0:
logging.error("ERROR building MARBL library")
sys.exit(1)

# -----------------------------------------------

Expand All @@ -160,7 +163,10 @@ def build_exe(self, loc_compiler=None):
makecmd = 'make %s' % loc_compiler
if self._mpitasks > 0:
makecmd += ' USEMPI=TRUE'
sh_command('cd %s; %s' % (drv_dir, makecmd))
status_code = sh_command('cd %s; %s' % (drv_dir, makecmd))
if status_code != 0:
logging.error("ERROR building MARBL stand-alone driver")
sys.exit(1)

# -----------------------------------------------

Expand Down Expand Up @@ -205,7 +211,7 @@ def run_exe(self):
status_code = sh_command(execmd)
if status_code != 0:
logging.error("ERROR in executable")
sys.exit(status_code)
sys.exit(1)

# -----------------------------------------------
# PRIVATE ROUTINES
Expand Down

0 comments on commit 3e35491

Please sign in to comment.