3131
3232my $what = shift || " " ;
3333if ($what =~
34- / ^(check|installcheck|plcheck|contribcheck|ecpgcheck|isolationcheck|upgradecheck)$ /i
34+ / ^(check|installcheck|plcheck|contribcheck|modulescheck| ecpgcheck|isolationcheck|upgradecheck)$ /i
3535 )
3636{
3737 $what = uc $what ;
4949copy(" $Config /regress/regress.dll" , " src/test/regress" );
5050copy(" $Config /dummy_seclabel/dummy_seclabel.dll" , " src/test/regress" );
5151
52- $ENV {PATH } = " ../../../ $Config /libpq;../.. /$Config /libpq;$ENV {PATH}" ;
52+ $ENV {PATH } = " $topdir / $Config /libpq;$topdir /$Config /libpq;$ENV {PATH}" ;
5353
5454my $schedule = shift ;
5555unless ($schedule )
7676 INSTALLCHECK => \&installcheck,
7777 ECPGCHECK => \&ecpgcheck,
7878 CONTRIBCHECK => \&contribcheck,
79+ MODULESCHECK => \&modulescheck,
7980 ISOLATIONCHECK => \&isolationcheck,
8081 UPGRADECHECK => \&upgradecheck,);
8182
@@ -213,10 +214,39 @@ sub plcheck
213214 chdir " ../../.." ;
214215}
215216
216- sub contribcheck
217+ sub subdircheck
217218{
218- chdir " ../../../contrib" ;
219+ my $subdir = shift ;
220+ my $module = shift ;
219221 my $mstat = 0;
222+
223+ if ( ! -d " $module /sql" ||
224+ ! -d " $module /expected" ||
225+ ( ! -f " $module /GNUmakefile" && ! -f " $module /Makefile" ))
226+ {
227+ return ;
228+ }
229+ chdir $module ;
230+ print
231+ " ============================================================\n " ;
232+ print " Checking $module \n " ;
233+ my @tests = fetchTests();
234+ my @opts = fetchRegressOpts();
235+ my @args = (
236+ " $topdir /$Config /pg_regress/pg_regress" ,
237+ " --psqldir=$topdir /$Config /psql" ,
238+ " --dbname=contrib_regression" , @opts , @tests );
239+ system (@args );
240+ my $status = $? >> 8;
241+ $mstat ||= $status ;
242+ chdir " .." ;
243+
244+ exit $mstat if $mstat ;
245+ }
246+
247+ sub contribcheck
248+ {
249+ chdir " $topdir /contrib" ;
220250 foreach my $module (glob (" *" ))
221251 {
222252 # these configuration-based exclusions must match Install.pm
@@ -225,28 +255,20 @@ sub contribcheck
225255 next if ($module eq " xml2" && !defined ($config -> {xml }));
226256 next if ($module eq " sepgsql" );
227257
228- next
229- unless -d " $module /sql"
230- && -d " $module /expected"
231- && (-f " $module /GNUmakefile" || -f " $module /Makefile" );
232- chdir $module ;
233- print
234- " ============================================================\n " ;
235- print " Checking $module \n " ;
236- my @tests = fetchTests();
237- my @opts = fetchRegressOpts();
238- my @args = (
239- " ../../$Config /pg_regress/pg_regress" ,
240- " --psqldir=../../$Config /psql" ,
241- " --dbname=contrib_regression" , @opts , @tests );
242- system (@args );
243- my $status = $? >> 8;
244- $mstat ||= $status ;
245- chdir " .." ;
258+ subdircheck(" $topdir /contrib" , $module );
246259 }
247- exit $mstat if $mstat ;
248260}
249261
262+ sub modulescheck
263+ {
264+ chdir " $topdir /src/test/modules" ;
265+ foreach my $module (glob (" *" ))
266+ {
267+ subdircheck(" $topdir /src/test/modules" , $module );
268+ }
269+ }
270+
271+
250272# Run "initdb", then reconfigure authentication.
251273sub standard_initdb
252274{
0 commit comments