Skip to content

Commit 22fe88b

Browse files
committed
Libpq-batch tests.
1 parent d2c2c83 commit 22fe88b

File tree

7 files changed

+1517
-1
lines changed

7 files changed

+1517
-1
lines changed

src/test/modules/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ SUBDIRS = \
1717
test_extensions \
1818
test_ginpostinglist \
1919
test_integerset \
20+
test_libpq \
2021
test_misc \
2122
test_parser \
2223
test_pg_dump \
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Generated subdirectories
2+
/log/
3+
/results/
4+
/tmp_check/
5+
/testlibpqbatch

src/test/modules/test_libpq/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# src/test/modules/test_libpq/Makefile
2+
3+
OBJS = testlibpqbatch.o
4+
PROGRAM = testlibpqbatch
5+
6+
PG_CPPFLAGS = -I$(libpq_srcdir)
7+
PG_LIBS += $(libpq)
8+
9+
ifdef USE_PGXS
10+
PG_CONFIG = pg_config
11+
PGXS := $(shell $(PG_CONFIG) --pgxs)
12+
include $(PGXS)
13+
else
14+
subdir = src/test/modules/test_libpq
15+
top_builddir = ../../../..
16+
include $(top_builddir)/src/Makefile.global
17+
include $(top_srcdir)/contrib/contrib-global.mk
18+
endif
19+
20+
testlibpqbatch.o: testlibpqbatch.c
21+
testlibpqbatch: testlibpqbatch.o
22+
check: testlibpqbatch prove-check
23+
24+
prove-check:
25+
$(prove_check)

src/test/modules/test_libpq/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test programs and libraries for libpq
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use strict;
2+
use warnings;
3+
4+
use Config;
5+
use PostgresNode;
6+
use TestLib;
7+
use Test::More tests => 6;
8+
use Cwd;
9+
10+
my $node = get_new_node('main');
11+
$node->init;
12+
$node->start;
13+
14+
my $port = $node->port;
15+
16+
my $numrows = 10000;
17+
my @tests =
18+
qw(disallowed_in_batch simple_batch multi_batch batch_abort timings singlerowmode);
19+
$ENV{PATH} = "$ENV{PATH}:" . getcwd();
20+
for my $testname (@tests)
21+
{
22+
$node->command_ok(
23+
[ 'testlibpqbatch', 'dbname=postgres', "$numrows", "$testname" ],
24+
"testlibpqbatch $testname");
25+
}
26+
27+
$node->stop('fast');

0 commit comments

Comments
 (0)