mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Start a separate test suite for plpgsql
The plpgsql.sql test file in the main regression tests is now by far the largest after numeric_big, making editing and managing the test cases very cumbersome. The other PLs have their own test suites split up into smaller files by topic. It would be nice to have that for plpgsql as well. So, to get that started, set up test infrastructure in src/pl/plpgsql/src/ and split out the recently added procedure test cases into a new file there. That file now mirrors the test cases added to the other PLs, making managing those matching tests a bit easier too. msvc build system changes with help from Michael Paquier
This commit is contained in:
@ -248,23 +248,32 @@ sub taptest
|
||||
|
||||
sub plcheck
|
||||
{
|
||||
chdir "../../pl";
|
||||
chdir "$topdir/src/pl";
|
||||
|
||||
foreach my $pl (glob("*"))
|
||||
foreach my $dir (glob("*/src *"))
|
||||
{
|
||||
next unless -d "$pl/sql" && -d "$pl/expected";
|
||||
my $lang = $pl eq 'tcl' ? 'pltcl' : $pl;
|
||||
next unless -d "$dir/sql" && -d "$dir/expected";
|
||||
my $lang;
|
||||
if ($dir eq 'plpgsql/src') {
|
||||
$lang = 'plpgsql';
|
||||
}
|
||||
elsif ($dir eq 'tcl') {
|
||||
$lang = 'pltcl';
|
||||
}
|
||||
else {
|
||||
$lang = $dir;
|
||||
}
|
||||
if ($lang eq 'plpython')
|
||||
{
|
||||
next unless -d "../../$Config/plpython2";
|
||||
next unless -d "$topdir/$Config/plpython2";
|
||||
$lang = 'plpythonu';
|
||||
}
|
||||
else
|
||||
{
|
||||
next unless -d "../../$Config/$lang";
|
||||
next unless -d "$topdir/$Config/$lang";
|
||||
}
|
||||
my @lang_args = ("--load-extension=$lang");
|
||||
chdir $pl;
|
||||
chdir $dir;
|
||||
my @tests = fetchTests();
|
||||
if ($lang eq 'plperl')
|
||||
{
|
||||
@ -285,16 +294,16 @@ sub plcheck
|
||||
"============================================================\n";
|
||||
print "Checking $lang\n";
|
||||
my @args = (
|
||||
"../../../$Config/pg_regress/pg_regress",
|
||||
"--bindir=../../../$Config/psql",
|
||||
"$topdir/$Config/pg_regress/pg_regress",
|
||||
"--bindir=$topdir/$Config/psql",
|
||||
"--dbname=pl_regression", @lang_args, @tests);
|
||||
system(@args);
|
||||
my $status = $? >> 8;
|
||||
exit $status if $status;
|
||||
chdir "..";
|
||||
chdir "$topdir/src/pl";
|
||||
}
|
||||
|
||||
chdir "../../..";
|
||||
chdir "$topdir";
|
||||
}
|
||||
|
||||
sub subdircheck
|
||||
|
Reference in New Issue
Block a user