From 32aac55875f324f8c3d85dad8483604eae65e3e8 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 20 Aug 2020 10:54:17 +0200 Subject: [PATCH] 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 --- Makefile.am | 7 ++++++- agent/Makefile.am | 4 ++++ common/Makefile.am | 4 ++++ configure.ac | 26 ++++++++++++++++++++++++++ dirmngr/Makefile.am | 4 ++++ g10/Makefile.am | 4 ++++ g13/Makefile.am | 4 ++++ sm/Makefile.am | 4 ++++ tests/Makefile.am | 2 +- 9 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index d6e7b7dec..405d99d09 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,10 +99,15 @@ doc = doc else doc = endif +if DISABLE_TESTS +tests = +else +tests = tests +endif SUBDIRS = m4 common regexp kbx \ ${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \ - tools po ${doc} tests + tools po ${doc} ${tests} dist_doc_DATA = README diff --git a/agent/Makefile.am b/agent/Makefile.am index 64d308838..2688ba967 100644 --- a/agent/Makefile.am +++ b/agent/Makefile.am @@ -103,7 +103,11 @@ $(PROGRAMS): $(common_libs) $(commonpth_libs) $(pwquery_libs) # # Module tests # +if DISABLE_TESTS +TESTS = +else TESTS = t-protect +endif t_common_ldadd = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \ $(LIBINTL) $(LIBICONV) $(NETLIBS) diff --git a/common/Makefile.am b/common/Makefile.am index 65caae23a..11277ca20 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -28,7 +28,11 @@ if !HAVE_W32CE_SYSTEM noinst_LIBRARIES += libsimple-pwquery.a endif noinst_PROGRAMS = $(module_tests) $(module_maint_tests) +if DISABLE_TESTS +TESTS = +else TESTS = $(module_tests) +endif BUILT_SOURCES = audit-events.h status-codes.h diff --git a/configure.ac b/configure.ac index 9eb25bd02..47d52fbdc 100644 --- a/configure.ac +++ b/configure.ac @@ -1730,6 +1730,16 @@ if test "$run_all_tests" = "yes"; then [Defined if "make check" shall run all tests]) 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 # 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_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(NO_TRUST_MODELS, test "$use_trust_models" = no) AM_CONDITIONAL(USE_TOFU, test "$use_tofu" = yes) @@ -2089,3 +2100,18 @@ cat <