diff options
author | Andrew Dunstan | 2009-08-18 22:36:56 +0000 |
---|---|---|
committer | Andrew Dunstan | 2009-08-18 22:36:56 +0000 |
commit | 19eba652c15b624bf45a3532285d6e1d212ff8de (patch) | |
tree | 061c85e992f8e38ec87ad76b4f1f18d6a056f87d | |
parent | fa8caa0c24826c5db453003833c26f3d593a80ea (diff) |
Pick up REGRESS_OPTS from contrib makefiles. Along the way, fix ordering of makefile tests to mimic gmake.
-rw-r--r-- | src/tools/msvc/vcregress.pl | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 5fc60dac8e..cf0edfdc74 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -180,15 +180,16 @@ sub contribcheck { next unless -d "$module/sql" && -d "$module/expected" && - (-f "$module/Makefile" || -f "$module/GNUmakefile"); + (-f "$module/GNUmakefile" || -f "$module/Makefile"); chdir $module; print "============================================================\n"; print "Checking $module\n"; my @tests = fetchTests(); + my @opts = fetchRegressOpts(); my @args = ( "../../$Config/pg_regress/pg_regress", "--psqldir=../../$Config/psql", - "--dbname=contrib_regression",@tests + "--dbname=contrib_regression",@opts,@tests ); system(@args); my $status = $? >> 8; @@ -198,12 +199,31 @@ sub contribcheck exit $mstat if $mstat; } +sub fetchRegressOpts +{ + my $handle; + open($handle,"<GNUmakefile") + || open($handle,"<Makefile") + || die "Could not open Makefile"; + local($/) = undef; + my $m = <$handle>; + close($handle); + my @opts; + if ($m =~ /^\s*REGRESS_OPTS\s*=(.*)/m) + { + # ignore options that use makefile variables - can't handle those + # ignore anything that isn't an option staring with -- + @opts = grep { $_ !~ /\$\(/ && $_ =~ /^--/ } split(/\s+/,$1); + } + return @opts; +} + sub fetchTests { my $handle; - open($handle,"<Makefile") - || open($handle,"<GNUmakefile") + open($handle,"<GNUmakefile") + || open($handle,"<Makefile") || die "Could not open Makefile"; local($/) = undef; my $m = <$handle>; |