Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 16381b2

Browse files
committed
Add configure --enable-tap-tests option
Don't skip the TAP tests anymore when IPC::Run is not found. This will fail normally now.
1 parent 4ffa880 commit 16381b2

File tree

6 files changed

+76
-14
lines changed

6 files changed

+76
-14
lines changed

configure

+40-1
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ CPPFLAGS
728728
LDFLAGS
729729
CFLAGS
730730
CC
731+
enable_tap_tests
731732
enable_dtrace
732733
DTRACEFLAGS
733734
DTRACE
@@ -806,6 +807,7 @@ enable_debug
806807
enable_profiling
807808
enable_coverage
808809
enable_dtrace
810+
enable_tap_tests
809811
with_blocksize
810812
with_segsize
811813
with_wal_blocksize
@@ -1474,6 +1476,7 @@ Optional Features:
14741476
--enable-profiling build with profiling enabled
14751477
--enable-coverage build with coverage testing instrumentation
14761478
--enable-dtrace build with DTrace support
1479+
--enable-tap-tests enable TAP tests (requires Perl and IPC::Run)
14771480
--enable-depend turn on automatic dependency tracking
14781481
--enable-cassert enable assertion checks (for debugging)
14791482
--disable-thread-safety disable thread-safety in client libraries
@@ -3436,6 +3439,34 @@ fi
34363439

34373440

34383441

3442+
#
3443+
# TAP tests
3444+
#
3445+
3446+
3447+
# Check whether --enable-tap-tests was given.
3448+
if test "${enable_tap_tests+set}" = set; then :
3449+
enableval=$enable_tap_tests;
3450+
case $enableval in
3451+
yes)
3452+
:
3453+
;;
3454+
no)
3455+
:
3456+
;;
3457+
*)
3458+
as_fn_error $? "no argument expected for --enable-tap-tests option" "$LINENO" 5
3459+
;;
3460+
esac
3461+
3462+
else
3463+
enable_tap_tests=no
3464+
3465+
fi
3466+
3467+
3468+
3469+
34393470
#
34403471
# Block size
34413472
#
@@ -14655,7 +14686,8 @@ done
1465514686
#
1465614687
# Check for test tools
1465714688
#
14658-
for ac_prog in prove
14689+
if test "$enable_tap_tests" = yes; then
14690+
for ac_prog in prove
1465914691
do
1466014692
# Extract the first word of "$ac_prog", so it can be a program name with args.
1466114693
set dummy $ac_prog; ac_word=$2
@@ -14697,6 +14729,13 @@ fi
1469714729
test -n "$PROVE" && break
1469814730
done
1469914731

14732+
if test -z "$PROVE"; then
14733+
as_fn_error $? "prove not found" "$LINENO" 5
14734+
fi
14735+
if test -z "$PERL"; then
14736+
as_fn_error $? "Perl not found" "$LINENO" 5
14737+
fi
14738+
fi
1470014739

1470114740
# Thread testing
1470214741

configure.in

+16-1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ fi
223223
AC_SUBST(DTRACEFLAGS)])
224224
AC_SUBST(enable_dtrace)
225225

226+
#
227+
# TAP tests
228+
#
229+
PGAC_ARG_BOOL(enable, tap-tests, no,
230+
[enable TAP tests (requires Perl and IPC::Run)])
231+
AC_SUBST(enable_tap_tests)
232+
226233
#
227234
# Block size
228235
#
@@ -1908,7 +1915,15 @@ AC_CHECK_PROGS(OSX, [osx sgml2xml sx])
19081915
#
19091916
# Check for test tools
19101917
#
1911-
AC_CHECK_PROGS(PROVE, prove)
1918+
if test "$enable_tap_tests" = yes; then
1919+
AC_CHECK_PROGS(PROVE, prove)
1920+
if test -z "$PROVE"; then
1921+
AC_MSG_ERROR([prove not found])
1922+
fi
1923+
if test -z "$PERL"; then
1924+
AC_MSG_ERROR([Perl not found])
1925+
fi
1926+
fi
19121927

19131928
# Thread testing
19141929

doc/src/sgml/installation.sgml

+10
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,16 @@ su - postgres
12711271
</listitem>
12721272
</varlistentry>
12731273

1274+
<varlistentry>
1275+
<term><option>--enable-tap-tests</option></term>
1276+
<listitem>
1277+
<para>
1278+
Enable tests using the Perl TAP tools. This requires a Perl
1279+
installation and the Perl module <literal>IPC::Run</literal>.
1280+
See <xref linkend="regress-tap"> for more information.
1281+
</para>
1282+
</listitem>
1283+
</varlistentry>
12741284
</variablelist>
12751285
</para>
12761286

doc/src/sgml/regress.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ make -C src/bin check PROVE_FLAGS='--reverse'
676676

677677
<para>
678678
The tests written in Perl require the Perl
679-
module <literal>IPC::Run</literal>, otherwise most tests will be skipped.
679+
module <literal>IPC::Run</literal>.
680680
This module is available from CPAN or an operating system package.
681681
</para>
682682
</sect1>

src/Makefile.global.in

+8
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ enable_nls = @enable_nls@
174174
enable_debug = @enable_debug@
175175
enable_dtrace = @enable_dtrace@
176176
enable_coverage = @enable_coverage@
177+
enable_tap_tests = @enable_tap_tests@
177178
enable_thread_safety = @enable_thread_safety@
178179

179180
python_enable_shared = @python_enable_shared@
@@ -310,6 +311,8 @@ define ld_library_path_var
310311
$(if $(filter $(PORTNAME),darwin),DYLD_LIBRARY_PATH,$(if $(filter $(PORTNAME),aix),LIBPATH,LD_LIBRARY_PATH))
311312
endef
312313

314+
ifeq ($(enable_tap_tests),yes)
315+
313316
define prove_installcheck
314317
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) t/*.pl
315318
endef
@@ -320,6 +323,11 @@ $(MAKE) -C $(top_builddir) DESTDIR='$(CURDIR)'/tmp_check/install install >'$(CUR
320323
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(CURDIR)/tmp_check/install$(bindir):$$PATH" $(call add_to_path,$(ld_library_path_var),$(CURDIR)/tmp_check/install$(libdir)) PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) t/*.pl
321324
endef
322325

326+
else
327+
prove_installcheck = @echo "TAP tests not enabled"
328+
prove_check = $(prove_installcheck)
329+
endif
330+
323331
# Installation.
324332

325333
install_bin = @install_bin@

src/test/perl/TestLib.pm

+1-11
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,9 @@ our @EXPORT = qw(
2525
use Cwd;
2626
use File::Spec;
2727
use File::Temp ();
28+
use IPC::Run qw(run start);
2829
use Test::More;
2930

30-
BEGIN
31-
{
32-
eval {
33-
require IPC::Run;
34-
import IPC::Run qw(run start);
35-
1;
36-
} or do
37-
{
38-
plan skip_all => "IPC::Run not available";
39-
};
40-
}
4131

4232
# Set to untranslated messages, to be able to compare program output
4333
# with expected strings.

0 commit comments

Comments
 (0)