In bisect.pl, provide a default test for --validate, and summary output.
authorNicholas Clark <nick@ccl4.org>
Tue, 1 Nov 2011 21:48:41 +0000 (22:48 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 1 Nov 2011 21:48:41 +0000 (22:48 +0100)
If no test case is specified for --validate, use TEST to run t/base/*.t
We can't run minitest because some tests fail on earlier versions, and
bisect-runner.pl intentionally doesn't patch any regression tests.

Porting/bisect-runner.pl
Porting/bisect.pl

index d6e9c23..194fbb9 100755 (executable)
@@ -418,6 +418,9 @@ OS/CPU/compiler combination. For example
 
     ../perl/Porting/bisect.pl --validate -le 'print "Hello from $]"'
 
+If no testcase is specified, the default is to use F<t/TEST> to run
+F<t/base/*.t>
+
 =item *
 
 --check-args
index d49223d..8284005 100755 (executable)
@@ -12,6 +12,9 @@ unshift @ARGV, '--help' unless GetOptions('start=s' => \$start,
                                           'end=s' => \$end,
                                           validate => \$validate);
 
+@ARGV = ('--', 'sh', '-c', 'cd t && ./perl TEST base/*.t')
+    if $validate && !@ARGV;
+
 my $runner = $0;
 $runner =~ s/bisect\.pl/bisect-runner.pl/;
 
@@ -63,11 +66,18 @@ sub validate {
     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;
+    return $commit;
 }
 
 if ($validate) {
-    validate $_ foreach 'blead', reverse @stable;
-    exit 0;
+    require Text::Wrap;
+    my @built = map {validate $_} 'blead', reverse @stable;
+    if (@built) {
+        print Text::Wrap::wrap("", "", "Successfully validated @built\n");
+        exit 0;
+    }
+    print "Did not validate anything\n";
+    exit 1;
 }
 
 my $git_version = `git --version`;