diff --git a/tools/sh_commands.py b/tools/sh_commands.py index 0234eff4136b8d359c3862ab00ae39fa483d07a3..8282f8840138e3c1bc3f501386d9fe02aff4d094 100644 --- a/tools/sh_commands.py +++ b/tools/sh_commands.py @@ -43,7 +43,6 @@ except Exception as e: ################################ # common ################################ -logger = logging.getLogger('MACE') def strip_invalid_utf8(str): @@ -85,6 +84,15 @@ class BuildType(object): code = 'code' +def stdout_success(stdout): + stdout_lines = stdout.split("\n") + for line in stdout_lines: + if "Aborted" in line or "FAILED" in line or \ + "Segmentation fault" in line: + return False + return True + + ################################ # clear data ################################ @@ -740,8 +748,11 @@ def tuning_run(abi, _tty_in=True, _out=process_output, _err_to_out=True) + stdout = "".join(stdout_buff) + if not stdout_success(stdout): + common.MaceLogger.error("Mace Run", "Mace run failed.") print("Running finished!\n") - return "".join(stdout_buff) + return stdout def validate_model(abi,