From b826a648121a8e343f6443f27f2ab2b8eb6ac231 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 23 Nov 2011 21:39:06 +0100 Subject: [PATCH] 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. --- Porting/bisect-runner.pl | 5 ++++- Porting/bisect.pl | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl index 41e15cc..711a14a 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 d28e1c5..f2e68ce 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/; -- 2.7.4