1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

build: New configure option --disable-tests

* configure.ac: Add option --disable-tests.  Print warnings in the
summary.
(DISABLE_TESTS): New am_conditional.
--
GnuPG-bug-id: 4960
This commit is contained in:
Werner Koch 2020-08-20 10:54:17 +02:00
parent 4c54a0e34f
commit 32aac55875
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
9 changed files with 57 additions and 2 deletions

View File

@ -99,10 +99,15 @@ doc = doc
else else
doc = doc =
endif endif
if DISABLE_TESTS
tests =
else
tests = tests
endif
SUBDIRS = m4 common regexp kbx \ SUBDIRS = m4 common regexp kbx \
${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \ ${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \
tools po ${doc} tests tools po ${doc} ${tests}
dist_doc_DATA = README dist_doc_DATA = README

View File

@ -103,7 +103,11 @@ $(PROGRAMS): $(common_libs) $(commonpth_libs) $(pwquery_libs)
# #
# Module tests # Module tests
# #
if DISABLE_TESTS
TESTS =
else
TESTS = t-protect TESTS = t-protect
endif
t_common_ldadd = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \ t_common_ldadd = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
$(LIBINTL) $(LIBICONV) $(NETLIBS) $(LIBINTL) $(LIBICONV) $(NETLIBS)

View File

@ -28,7 +28,11 @@ if !HAVE_W32CE_SYSTEM
noinst_LIBRARIES += libsimple-pwquery.a noinst_LIBRARIES += libsimple-pwquery.a
endif endif
noinst_PROGRAMS = $(module_tests) $(module_maint_tests) noinst_PROGRAMS = $(module_tests) $(module_maint_tests)
if DISABLE_TESTS
TESTS =
else
TESTS = $(module_tests) TESTS = $(module_tests)
endif
BUILT_SOURCES = audit-events.h status-codes.h BUILT_SOURCES = audit-events.h status-codes.h

View File

@ -1730,6 +1730,16 @@ if test "$run_all_tests" = "yes"; then
[Defined if "make check" shall run all tests]) [Defined if "make check" shall run all tests])
fi fi
#
# Configure option --disable-tests
#
AC_MSG_CHECKING([whether tests should be run])
AC_ARG_ENABLE(tests,
AC_HELP_STRING([--disable-tests],
[do not run any tests]),
run_tests=$enableval, run_tests=yes)
AC_MSG_RESULT($run_tests)
# #
# We do not want support for the GNUPG_BUILDDIR environment variable # We do not want support for the GNUPG_BUILDDIR environment variable
# in a released version. However, our regression tests suite requires # in a released version. However, our regression tests suite requires
@ -1791,6 +1801,7 @@ AM_CONDITIONAL(BUILD_SYMCRYPTRUN, test "$build_symcryptrun" = "yes")
AM_CONDITIONAL(BUILD_GPGTAR, test "$build_gpgtar" = "yes") AM_CONDITIONAL(BUILD_GPGTAR, test "$build_gpgtar" = "yes")
AM_CONDITIONAL(BUILD_WKS_TOOLS, test "$build_wks_tools" = "yes") AM_CONDITIONAL(BUILD_WKS_TOOLS, test "$build_wks_tools" = "yes")
AM_CONDITIONAL(DISABLE_TESTS, test "$run_tests" != yes)
AM_CONDITIONAL(ENABLE_CARD_SUPPORT, test "$card_support" = yes) AM_CONDITIONAL(ENABLE_CARD_SUPPORT, test "$card_support" = yes)
AM_CONDITIONAL(NO_TRUST_MODELS, test "$use_trust_models" = no) AM_CONDITIONAL(NO_TRUST_MODELS, test "$use_trust_models" = no)
AM_CONDITIONAL(USE_TOFU, test "$use_tofu" = yes) AM_CONDITIONAL(USE_TOFU, test "$use_tofu" = yes)
@ -2089,3 +2100,18 @@ cat <<G10EOF
G10EOF G10EOF
fi fi
if test "${build_gpg}" != "yes"; then
cat <<G10EOF
Warning: The component "gpg" is used by other components as
well as for the test suite. You have disabled
this component and thus other things won't work.
G10EOF
fi
if test "${run_tests}" != "yes"; then
cat <<G10EOF
Warning: The use of the test suite has been disabled!
This is in almost all cases a bad idea. Take care.
G10EOF
fi

View File

@ -33,7 +33,11 @@ libexec_PROGRAMS =
endif endif
noinst_PROGRAMS = $(module_tests) $(module_net_tests) $(module_maint_tests) noinst_PROGRAMS = $(module_tests) $(module_net_tests) $(module_maint_tests)
if DISABLE_TESTS
TESTS =
else
TESTS = $(module_tests) $(module_net_tests) TESTS = $(module_tests) $(module_net_tests)
endif
AM_CPPFLAGS = AM_CPPFLAGS =

View File

@ -54,7 +54,11 @@ endif
#noinst_PROGRAMS += gpgcompose #noinst_PROGRAMS += gpgcompose
#endif #endif
noinst_PROGRAMS += $(module_tests) noinst_PROGRAMS += $(module_tests)
if DISABLE_TESTS
TESTS =
else
TESTS = $(module_tests) TESTS = $(module_tests)
endif
TESTS_ENVIRONMENT = \ TESTS_ENVIRONMENT = \
abs_top_srcdir=$(abs_top_srcdir) abs_top_srcdir=$(abs_top_srcdir)

View File

@ -24,7 +24,11 @@ bin_PROGRAMS = g13
sbin_PROGRAMS = g13-syshelp sbin_PROGRAMS = g13-syshelp
noinst_PROGRAMS = $(module_tests) noinst_PROGRAMS = $(module_tests)
if DISABLE_TESTS
TESTS =
else
TESTS = $(module_tests) TESTS = $(module_tests)
endif
AM_CPPFLAGS = AM_CPPFLAGS =

View File

@ -22,7 +22,11 @@ EXTRA_DIST = ChangeLog-2011 gpgsm-w32info.rc
bin_PROGRAMS = gpgsm bin_PROGRAMS = gpgsm
noinst_PROGRAMS = $(module_tests) $(module_maint_tests) noinst_PROGRAMS = $(module_tests) $(module_maint_tests)
if DISABLE_TESTS
TESTS =
else
TESTS = $(module_tests) TESTS = $(module_tests)
endif
AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS) $(LIBASSUAN_CFLAGS) AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS) $(LIBASSUAN_CFLAGS)

View File

@ -1,4 +1,4 @@
# Makefile.am -tests makefile for libxtime # Makefile.am
# Copyright (C) 2002 Free Software Foundation, Inc. # Copyright (C) 2002 Free Software Foundation, Inc.
# #
# This file is part of GnuPG. # This file is part of GnuPG.