summaryrefslogtreecommitdiff
path: root/Porting
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-09-30 08:43:49 +0200
committerNicholas Clark <nick@ccl4.org>2011-09-30 08:43:49 +0200
commitf10508112af8bb9bf7bb87957a6b2425eabaeb44 (patch)
treef792fd43cb0373934a500f6cd4f27a975e98c42e /Porting
parentab4a15f90ca61a09c8a3f7f387560b2b18d54157 (diff)
downloadperl-f10508112af8bb9bf7bb87957a6b2425eabaeb44.tar.gz
In bisect-runner.pl, refactor the reporting code into report_and_exit().
Diffstat (limited to 'Porting')
-rwxr-xr-xPorting/bisect-runner.pl27
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