Skip to content

Commit 9ca7b0b

Browse files
committed
Allow individual TAP tests to be run via PROVE_TESTS
Add a new optional Makefile variable PROVE_TESTS that, if passed as a space-separated list of paths relative to the Makefile invoking $(prove_check) or $(prove_installcheck), runs just those tests instead of t/*.pl . From: Craig Ringer <[email protected]> Reviewed-by: Michael Paquier <[email protected]>
1 parent 8ce4f59 commit 9ca7b0b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Makefile.global.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,12 @@ ifeq ($(enable_tap_tests),yes)
354354

355355
define prove_installcheck
356356
rm -rf $(CURDIR)/tmp_check/log
357-
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) t/*.pl
357+
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
358358
endef
359359

360360
define prove_check
361361
rm -rf $(CURDIR)/tmp_check/log
362-
cd $(srcdir) && TESTDIR='$(CURDIR)' $(with_temp_install) PGPORT='6$(DEF_PGPORT)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) t/*.pl
362+
cd $(srcdir) && TESTDIR='$(CURDIR)' $(with_temp_install) PGPORT='6$(DEF_PGPORT)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
363363
endef
364364

365365
else

src/test/perl/README

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ across the source tree, particularly tests in src/bin and src/test. It's used
66
to drive tests for backup and restore, replication, etc - anything that can't
77
really be expressed using pg_regress or the isolation test framework.
88

9+
The tests are invoked via perl's 'prove' command, wrapped in PostgreSQL
10+
makefiles to handle instance setup etc. See the $(prove_check) and
11+
$(prove_installcheck) targets in Makefile.global. By default every test in the
12+
t/ subdirectory is run. Individual test(s) can be run instead by passing
13+
something like PROVE_TESTS="t/001_testname.pl t/002_othertestname.pl" to make.
14+
915
You should prefer to write tests using pg_regress in src/test/regress, or
1016
isolation tester specs in src/test/isolation, if possible. If not, check to
1117
see if your new tests make sense under an existing tree in src/test, like

0 commit comments

Comments
 (0)