From 7bbd39e0da04cee932f4afe6a4c85ebb78f39a81 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Oct 2017 20:02:28 +0300 Subject: Add configure options for build with system catch and doctest. --- src/Makefile.am | 3 +++ src/maingui.cpp | 8 ++++++++ src/unittests/unittests.h | 8 ++++++++ 3 files changed, 19 insertions(+) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 7f22f0507..1b7ccd77f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -37,6 +37,9 @@ endif if ENABLE_UNITTESTSBIN_DOCTEST manaplustests_CXXFLAGS += -DUNITTESTS_DOCTEST endif +if ENABLE_UNITTESTS_EMBED +manaplustests_CXXFLAGS += -DUNITTESTS_EMBED +endif dyecmd_CXXFLAGS = -DPKG_DATADIR=\""$(pkgdatadir)/"\" \ -DLOCALEDIR=\""$(localedir)"\" \ diff --git a/src/maingui.cpp b/src/maingui.cpp index fc3df1b98..64fef6fbc 100644 --- a/src/maingui.cpp +++ b/src/maingui.cpp @@ -59,11 +59,19 @@ PRAGMA48(GCC diagnostic pop) #include "resources/dye/dyepalette.h" #ifdef UNITTESTS_CATCH #define CATCH_CONFIG_RUNNER +#ifdef UNITTESTS_EMBED #include "unittests/catch.hpp" +#else // UNITTESTS_EMBED +#include +#endif // UNITTESTS_EMBED #endif // UNITTESTS_CATCH #ifdef UNITTESTS_DOCTEST #define DOCTEST_CONFIG_IMPLEMENT +#ifdef UNITTESTS_EMBED #include "unittests/doctest.h" +#else // UNITTESTS_EMBED +#include +#endif // UNITTESTS_EMBED #endif // UNITTESTS_DOCTEST #else // UNITTESTS #include "utils/xml.h" diff --git a/src/unittests/unittests.h b/src/unittests/unittests.h index 672b2ca54..b0077cd70 100644 --- a/src/unittests/unittests.h +++ b/src/unittests/unittests.h @@ -24,7 +24,11 @@ #include "localconsts.h" #ifdef UNITTESTS_CATCH +#ifdef UNITTESTS_EMBED #include "unittests/catch.hpp" +#else // UNITTESTS_EMBED +#include +#endif // UNITTESTS_EMBED #endif // UNITTESTS_CATCH #ifdef UNITTESTS_DOCTEST @@ -41,7 +45,11 @@ PRAGMA5(GCC diagnostic push) PRAGMA5(GCC diagnostic ignored "-Wsuggest-override") +#ifdef UNITTESTS_EMBED #include "unittests/doctest.h" +#else // UNITTESTS_EMBED +#include +#endif // UNITTESTS_EMBED PRAGMA5(GCC diagnostic pop) #undef TEST_CASE -- cgit v1.2.3-70-g09d2