diff --git a/bin/run-util b/bin/run-util index 52997affe73611155ca5eecc715595eba6786e81_YmluL3J1bi11dGls..26080da93815ff0977915e6cf256af85f10e0b2e_YmluL3J1bi11dGls 100755 --- a/bin/run-util +++ b/bin/run-util @@ -26,5 +26,8 @@ self.base_command = get_var('command') self.command = None + # XXX having a list of acceptable status would be better (default to [0]) + self.accept_failure = bool(get_var('accept-failure')) + self.cwd = get_var('cwd') @@ -29,6 +32,5 @@ self.cwd = get_var('cwd') - def apply_data_env(self, data_env_data): variables_data = self._benchmark_data['simple-command'].get('variables') @@ -100,6 +102,8 @@ "--", cmd.command, ] + if cmd.accept_failure: + time_cmd.insert(-2, "--ignore-failure") cwd = data_env_path if cmd.cwd is not None: diff --git a/tests/test-simple-run.t b/tests/test-simple-run.t index 52997affe73611155ca5eecc715595eba6786e81_dGVzdHMvdGVzdC1zaW1wbGUtcnVuLnQ=..26080da93815ff0977915e6cf256af85f10e0b2e_dGVzdHMvdGVzdC1zaW1wbGUtcnVuLnQ= 100644 --- a/tests/test-simple-run.t +++ b/tests/test-simple-run.t @@ -74,6 +74,7 @@ $ env-desc set black-tiny-bad.pbd meta.name black.check.tiny $ env-desc set black-tiny-bad.pbd meta.method simple-command $ env-desc set black-tiny-bad.pbd simple-command.command "black --check {file}" + $ env-desc set black-tiny-bad.pbd simple-command.accept-failure "1" $ env-desc set black-tiny-bad.pbd simple-command.variables.file DATA-VARS:black.check.tiny.bad $ env-desc set black-tiny-bad.pbd simple-command.cwd DATA-VARS:. @@ -83,6 +84,7 @@ method = simple-command name = black.check.tiny simple-command: + accept-failure = 1 command = black --check {file} cwd = DATA-VARS:. variables: @@ -120,6 +122,7 @@ method = simple-command name = black.check.tiny simple-command: + accept-failure = 1 command = black --check {file} cwd = DATA-VARS:. variables: