From fec78ac900de7f61b7f08d14ffb526715e7942b0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Mar 2017 21:11:55 +0300 Subject: Add configure flag enable-unittestsbin for build unit tests binary but not run it. --- configure.ac | 14 +++++++++++++- src/Makefile.am | 11 +++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 834087ede..361baef7b 100755 --- a/configure.ac +++ b/configure.ac @@ -572,11 +572,23 @@ AC_ARG_ENABLE(unittests, yes) unittests_enabled=true ;; no) unittests_enabled=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-unittests) ;; esac],[unittests_enabled=false]) AM_CONDITIONAL(ENABLE_UNITTESTS, test x$unittests_enabled = xtrue) +# Enable unit tests binaries only +AC_ARG_ENABLE(unittestsbin, +[ --enable-unittestsbin Turn on unit tests binary compilation only], +[case "${enableval}" in + yes) unittestsbin_enabled=true + ;; + no) unittestsbin_enabled=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-unittestsbin) ;; +esac],[unittestsbin_enabled=false]) + +AM_CONDITIONAL(ENABLE_UNITTESTSBIN, test x$unittestsbin_enabled = xtrue) + # Enable tcmalloc AC_ARG_ENABLE(tcmalloc, [ --enable-tcmalloc Turn on tcmalloc], diff --git a/src/Makefile.am b/src/Makefile.am index 193d5b8ca..b3482391c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,6 +20,9 @@ else bin_PROGRAMS = endif endif +if ENABLE_UNITTESTSBIN +bin_PROGRAMS += manaplustests +endif dyecmd_CXXFLAGS = -DPKG_DATADIR=\""$(pkgdatadir)/"\" \ -DLOCALEDIR=\""$(localedir)"\" \ @@ -1932,9 +1935,6 @@ if ENABLE_MANAPLUSGAME manaplus_SOURCES += ${SRC} endif -if ENABLE_UNITTESTS -TESTS = manaplustests -check_PROGRAMS = manaplustests manaplustests_CXXFLAGS = ${manaplus_CXXFLAGS} \ -DUNITTESTS manaplustests_LDFLAGS = @@ -2008,8 +2008,11 @@ manaplustests_SOURCES += \ resources/map/maplayer_unittest.cc \ resources/resourcemanager/resourcemanager_unittest.cc \ gui/windowmanager_unittest.cc -endif +if ENABLE_UNITTESTS +TESTS = manaplustests +check_PROGRAMS = manaplustests +endif EXTRA_DIST = CMakeLists.txt \ winver.h.in \ -- cgit v1.2.3-60-g2f50