summaryrefslogtreecommitdiff
path: root/Porting/bisect.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-11-01 12:44:57 +0100
committerNicholas Clark <nick@ccl4.org>2011-11-01 22:11:49 +0100
commit195ed8b1c4f9c191c2845b65eb9519c0d4e0cf64 (patch)
tree11e4ad812b698548677cfefe31d4a1c4fefe04b6 /Porting/bisect.pl
parenta058c51605ec2d38bf37f2e2c4f81926e3a90ea9 (diff)
downloadperl-195ed8b1c4f9c191c2845b65eb9519c0d4e0cf64.tar.gz
Add a --validate option to bisect.pl to verify that stable releases build.
This is useful for validating a new OS/CPU/compiler combination, and for checking that refactoring bisect-runner.pl hasn't broken any that previously worked.
Diffstat (limited to 'Porting/bisect.pl')
-rwxr-xr-xPorting/bisect.pl20
1 files changed, 18 insertions, 2 deletions
diff --git a/Porting/bisect.pl b/Porting/bisect.pl
index 292a3ef50d..8a6b5df736 100755
--- a/Porting/bisect.pl
+++ b/Porting/bisect.pl
@@ -7,9 +7,10 @@ my $start_time = time;
# Which isn't what we want.
use Getopt::Long qw(:config pass_through no_auto_abbrev);
-my ($start, $end);
+my ($start, $end, $validate);
unshift @ARGV, '--help' unless GetOptions('start=s' => \$start,
- 'end=s' => \$end);
+ 'end=s' => \$end,
+ validate => \$validate);
my $runner = $0;
$runner =~ s/bisect\.pl/bisect-runner.pl/;
@@ -46,6 +47,21 @@ my $modified = () = `git ls-files --modified --deleted --others`;
die "This checkout is not clean - $modified modified or untracked file(s)"
if $modified;
+sub validate {
+ my $commit = shift;
+ print "Testing $commit...\n";
+ system "git checkout $commit </dev/null" and die;
+ my $ret = system $^X, $runner, '--no-clean', @ARGV;
+ die "Runner returned $ret, not 0 for revision $commit" if $ret;
+ system 'git clean -dxf </dev/null' and die;
+ system 'git reset --hard HEAD </dev/null' and die;
+}
+
+if ($validate) {
+ validate $_ foreach 'blead', reverse @stable;
+ exit 0;
+}
+
my $git_version = `git --version`;
if (defined $git_version
&& $git_version =~ /\Agit version (\d+\.\d+\.\d+)(.*)/) {