summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-19 01:10:09 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-19 01:10:09 +0300
commit05f22315081afa26d97ea6efd9892b3bc4a3429d (patch)
treead8b9db3087e8f3bf44598304bdf4a18c2f2e8df
parentfa1b15a140e006966c013e1f5aaefca2afa54a86 (diff)
downloadmanaplus-05f22315081afa26d97ea6efd9892b3bc4a3429d.tar.gz
manaplus-05f22315081afa26d97ea6efd9892b3bc4a3429d.tar.bz2
manaplus-05f22315081afa26d97ea6efd9892b3bc4a3429d.tar.xz
manaplus-05f22315081afa26d97ea6efd9892b3bc4a3429d.zip
Allow select catch or doctest in unit tests binary only compilation.
-rwxr-xr-xconfigure.ac20
-rw-r--r--src/Makefile.am19
2 files changed, 31 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index d8f039fa5..7436a52c3 100755
--- a/configure.ac
+++ b/configure.ac
@@ -610,13 +610,29 @@ AM_CONDITIONAL(ENABLE_UNITTESTS_DOCTEST, test x$unittests_doctest = xtrue)
AC_ARG_ENABLE(unittestsbin,
[ --enable-unittestsbin Turn on unit tests binary compilation only],
[case "${enableval}" in
- yes) unittestsbin_enabled=true
+ yes)
+ unittestsbin_enabled=true
+ unittestsbin_catch=true
+ unittestsbin_doctest=false
+ ;;
+ catch)
+ unittestsbin_enabled=true
+ unittestsbin_catch=true
+ unittestsbin_doctest=false
+ ;;
+ doctest)
+ unittestsbin_enabled=true
+ unittestsbin_catch=false
+ unittestsbin_doctest=true
;;
- no) unittestsbin_enabled=false ;;
+ 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)
+AM_CONDITIONAL(ENABLE_UNITTESTSBIN_CATCH, test x$unittestsbin_catch = xtrue)
+AM_CONDITIONAL(ENABLE_UNITTESTSBIN_DOCTEST, test x$unittestsbin_doctest = xtrue)
# Enable tcmalloc
AC_ARG_ENABLE(tcmalloc,
diff --git a/src/Makefile.am b/src/Makefile.am
index 5f52357ad..1ef983595 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,6 +24,19 @@ if ENABLE_UNITTESTSBIN
bin_PROGRAMS += manaplustests
endif
+if ENABLE_UNITTESTS_CATCH
+manaplustests_CXXFLAGS += -DUNITTESTS_CATCH
+endif
+if ENABLE_UNITTESTSBIN_CATCH
+manaplustests_CXXFLAGS += -DUNITTESTS_CATCH
+endif
+if ENABLE_UNITTESTS_DOCTEST
+manaplustests_CXXFLAGS += -DUNITTESTS_DOCTEST
+endif
+if ENABLE_UNITTESTSBIN_DOCTEST
+manaplustests_CXXFLAGS += -DUNITTESTS_DOCTEST
+endif
+
dyecmd_CXXFLAGS = -DPKG_DATADIR=\""$(pkgdatadir)/"\" \
-DLOCALEDIR=\""$(localedir)"\" \
-Wall
@@ -1952,12 +1965,6 @@ endif
manaplustests_CXXFLAGS = ${manaplus_CXXFLAGS} \
-DUNITTESTS
manaplustests_LDFLAGS =
-if ENABLE_UNITTESTS_CATCH
-manaplustests_CXXFLAGS += -DUNITTESTS_CATCH
-endif
-if ENABLE_UNITTESTS_DOCTEST
-manaplustests_CXXFLAGS += -DUNITTESTS_DOCTEST
-endif
if ENABLE_PUGIXML
manaplustests_CXXFLAGS += -DENABLE_PUGIXML
endif