From 7b48eb2159c8b2d14b5b35f39e27a5f74b64b977 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Thu, 2 May 2019 14:06:07 +0100 Subject: [PATCH] build: disable testing by default Change `configure` to not build the unit tests by default. ``` --testing Enable Unit Testing --coverage Enable Coverage Testing (enables Unit Testing) ``` Co-authored-by: Pietro Cerutti --- Makefile.autosetup | 4 ++++ auto.def | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile.autosetup b/Makefile.autosetup index d3349834b..e01d2b22e 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -443,12 +443,14 @@ distclean: clean $(RM) *.gc?? */*.gc?? test/*/*.gc?? $(RM) lcov.info lcov +@if ENABLE_COVERAGE # coverage testing coverage: all test $(RM) lcov lcov -t "test" -o lcov.info -c -d address -d config -d email -d mutt -genhtml -o lcov lcov.info -f lcov -l lcov.info +@endif ############################################################################## # include generated dependency files @@ -460,6 +462,8 @@ coverage: all test include po/Makefile include contrib/Makefile include doc/Makefile +@if ENABLE_UNIT_TESTS include test/Makefile +@endif # vim: set ts=8 noexpandtab: diff --git a/auto.def b/auto.def index f54b05f2c..5988a9571 100644 --- a/auto.def +++ b/auto.def @@ -18,7 +18,7 @@ define PACKAGE_VERSION "20180716" define BUGS_ADDRESS "neomutt-devel@neomutt.org" # Subdirectories that contain additional Makefile.autosetup files -set subdirs {po doc contrib test} +set subdirs {po doc contrib} ############################################################################### ############################################################################### @@ -89,8 +89,9 @@ options { with-tokyocabinet:path => "Location of TokyoCabinet" # System with-sysroot:path => "Target system root" -# Coverage testing - lcov=0 => "Enable Coverage Testing" +# Testing + testing=0 => "Enable Unit Testing" + coverage=0 => "Enable Coverage Testing" # Enable all options everything=0 => "Enable all options" } @@ -103,9 +104,9 @@ options { if {1} { # Keep sorted, please. foreach opt { - bdb doc everything fmemopen full-doc gdbm gnutls gpgme gss - homespool idn idn2 inotify kyotocabinet lcov lmdb locales-fix lua mixmaster nls - notmuch pgp qdbm sasl smime ssl tokyocabinet + bdb coverage doc everything fmemopen full-doc gdbm gnutls gpgme gss + homespool idn idn2 inotify kyotocabinet lmdb locales-fix lua mixmaster nls + notmuch pgp qdbm sasl smime ssl testing tokyocabinet } { define want-$opt [opt-bool $opt] } @@ -451,11 +452,19 @@ if {[get-define want-sasl]} { ############################################################################### # Coverage Testing -if {[get-define want-lcov]} { +if {[get-define want-coverage]} { + define ENABLE_COVERAGE define-append CFLAGS -fprofile-arcs -ftest-coverage define-append LDFLAGS -fprofile-arcs -ftest-coverage } +############################################################################### +# Unit Testing +if {[get-define want-testing]} { + define ENABLE_UNIT_TESTS + lappend subdirs test +} + ############################################################################### # Lua if {[get-define want-lua]} { -- 2.40.0