diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-09-30 08:43:49 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-09-30 08:43:49 +0200 |
commit | f10508112af8bb9bf7bb87957a6b2425eabaeb44 (patch) | |
tree | f792fd43cb0373934a500f6cd4f27a975e98c42e /Porting | |
parent | ab4a15f90ca61a09c8a3f7f387560b2b18d54157 (diff) | |
download | perl-f10508112af8bb9bf7bb87957a6b2425eabaeb44.tar.gz |
In bisect-runner.pl, refactor the reporting code into report_and_exit().
Diffstat (limited to 'Porting')
-rwxr-xr-x | Porting/bisect-runner.pl | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl index 719c065dc2..138a8fa268 100755 --- a/Porting/bisect-runner.pl +++ b/Porting/bisect-runner.pl @@ -66,6 +66,21 @@ sub skip { exit 125; } +sub report_and_exit { + my ($ret, $pass, $fail, $desc) = @_; + + clean(); + + my $got = ($test_should_pass ? !$ret : $ret) ? 'good' : 'bad'; + if ($ret) { + print "$got - $fail $desc\n"; + } else { + print "$got - $pass $desc\n"; + } + + exit($got eq 'bad'); +} + # Not going to assume that system perl is yet new enough to have autodie system 'git clean -dxf' and die; @@ -168,17 +183,7 @@ skip("could not build $target") # This is what we came here to run: my $ret = system @ARGV; -clean(); - -my $got = ($test_should_pass ? !$ret : $ret) ? 'good' : 'bad'; - -if ($ret) { - print "$got - non-zero exit from @ARGV\n"; -} else { - print "$got - zero exit from @ARGV\n"; -} - -exit($got eq 'bad'); +report_and_exit($ret, 'zero exit from', 'non-zero exit from', "@ARGV"); # Local variables: # cperl-indent-level: 4 |