summaryrefslogtreecommitdiff
path: root/Porting
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-11-23 21:39:06 +0100
committerNicholas Clark <nick@ccl4.org>2011-11-23 21:39:06 +0100
commitb826a648121a8e343f6443f27f2ab2b8eb6ac231 (patch)
tree22dc596e52202ea8c7c15e2b47d786a4c8f979ea /Porting
parent32ffe018e175b241416715c9a888fd780c57c9f6 (diff)
downloadperl-b826a648121a8e343f6443f27f2ab2b8eb6ac231.tar.gz
Move the implementation of --validate from bisect.pl to bisect-runner.pl
--validate sets a default testcase by assigning to @ARGV if its empty. It makes more sense to do this in bisect-runner.pl, as that processes options fully, unlike bisect.pl, which passes most through. Hence bisect.pl doesn't know if some elements of @ARGV are actually options, and hence no testcase has been supplied, and hence the default is needed. This change permits the use of --validate with build options such as -D to work as expected.
Diffstat (limited to 'Porting')
-rwxr-xr-xPorting/bisect-runner.pl5
-rwxr-xr-xPorting/bisect.pl4
2 files changed, 5 insertions, 4 deletions
diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl
index 41e15ccfea..711a14a714 100755
--- a/Porting/bisect-runner.pl
+++ b/Porting/bisect-runner.pl
@@ -63,7 +63,7 @@ unless(GetOptions(\%options,
'expect-fail' => sub { $options{'expect-pass'} = 0; },
'clean!', 'one-liner|e=s', 'match=s', 'force-manifest',
'force-regen', 'test-build', 'A=s@', 'l', 'w',
- 'check-args', 'check-shebang!', 'usage|help|?',
+ 'check-args', 'check-shebang!', 'usage|help|?', 'validate',
'D=s@' => sub {
my (undef, $val) = @_;
if ($val =~ /\A([^=]+)=(.*)/s) {
@@ -81,6 +81,9 @@ unless(GetOptions(\%options,
my ($target, $j, $match) = @options{qw(target jobs match)};
+@ARGV = ('sh', '-c', 'cd t && ./perl TEST base/*.t')
+ if $options{validate} && !@ARGV;
+
pod2usage(exitval => 255, verbose => 1) if $options{usage};
pod2usage(exitval => 255, verbose => 1)
unless @ARGV || $match || $options{'test-build'} || defined $options{'one-liner'};
diff --git a/Porting/bisect.pl b/Porting/bisect.pl
index d28e1c549c..f2e68ce8ae 100755
--- a/Porting/bisect.pl
+++ b/Porting/bisect.pl
@@ -17,9 +17,7 @@ my ($start, $end, $validate);
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;
+unshift @ARGV, '--validate' if $validate;
my $runner = $0;
$runner =~ s/bisect\.pl/bisect-runner.pl/;