From 8d3024a7e09246e44bf6d9ea14a36e6b03032e85 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 20 Sep 2021 10:15:12 +0200 Subject: It's not possible to compile out tests Tests are now compiled in if `ZEN_WITH_TESTS=1`, and compiled out if not. Compiling tests out reduces the footprint of the resulting executables quite significantly. --- zenstore-test/zenstore-test.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'zenstore-test/zenstore-test.cpp') diff --git a/zenstore-test/zenstore-test.cpp b/zenstore-test/zenstore-test.cpp index ed9a12566..e6bd92ab9 100644 --- a/zenstore-test/zenstore-test.cpp +++ b/zenstore-test/zenstore-test.cpp @@ -4,20 +4,21 @@ #include #include -#define DOCTEST_CONFIG_IMPLEMENT -#include -#undef DOCTEST_CONFIG_IMPLEMENT +#if ZEN_WITH_TESTS +# define DOCTEST_CONFIG_IMPLEMENT +# include +# undef DOCTEST_CONFIG_IMPLEMENT +#endif -void -forceLinkTests() +int +main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) { +#if ZEN_WITH_TESTS zen::zenstore_forcelinktests(); -} -int -main(int argc, char* argv[]) -{ zen::logging::InitializeLogging(); return doctest::Context(argc, argv).run(); +#else +#endif } -- cgit v1.2.3