1
1
2
2
# -*-perl-*- hey - emacs - this is a perl file
3
3
4
- # $PostgreSQL: pgsql/src/tools/msvc/vcregress.pl,v 1.10 2008/12/01 13:39:45 tgl Exp $
4
+ # $PostgreSQL: pgsql/src/tools/msvc/vcregress.pl,v 1.11 2009/08/18 22:36:56 adunstan Exp $
5
5
6
6
use strict;
7
7
@@ -180,15 +180,16 @@ sub contribcheck
180
180
{
181
181
next unless -d " $module /sql" &&
182
182
-d " $module /expected" &&
183
- (-f " $module /Makefile " || -f " $module /GNUmakefile " );
183
+ (-f " $module /GNUmakefile " || -f " $module /Makefile " );
184
184
chdir $module ;
185
185
print " ============================================================\n " ;
186
186
print " Checking $module \n " ;
187
187
my @tests = fetchTests();
188
+ my @opts = fetchRegressOpts();
188
189
my @args = (
189
190
" ../../$Config /pg_regress/pg_regress" ,
190
191
" --psqldir=../../$Config /psql" ,
191
- " --dbname=contrib_regression" ,@tests
192
+ " --dbname=contrib_regression" ,@opts , @ tests
192
193
);
193
194
system (@args );
194
195
my $status = $? >> 8;
@@ -198,12 +199,31 @@ sub contribcheck
198
199
exit $mstat if $mstat ;
199
200
}
200
201
202
+ sub fetchRegressOpts
203
+ {
204
+ my $handle ;
205
+ open ($handle ," <GNUmakefile" )
206
+ || open ($handle ," <Makefile" )
207
+ || die " Could not open Makefile" ;
208
+ local ($/ ) = undef ;
209
+ my $m = <$handle >;
210
+ close ($handle );
211
+ my @opts ;
212
+ if ($m =~ / ^\s *REGRESS_OPTS\s *=(.*)/m )
213
+ {
214
+ # ignore options that use makefile variables - can't handle those
215
+ # ignore anything that isn't an option staring with --
216
+ @opts = grep { $_ !~ / \$\( / && $_ =~ / ^--/ } split (/ \s +/ ,$1 );
217
+ }
218
+ return @opts ;
219
+ }
220
+
201
221
sub fetchTests
202
222
{
203
223
204
224
my $handle ;
205
- open ($handle ," <Makefile " )
206
- || open ($handle ," <GNUmakefile " )
225
+ open ($handle ," <GNUmakefile " )
226
+ || open ($handle ," <Makefile " )
207
227
|| die " Could not open Makefile" ;
208
228
local ($/ ) = undef ;
209
229
my $m = <$handle >;
0 commit comments