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. --- zencore/stats.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'zencore/stats.cpp') diff --git a/zencore/stats.cpp b/zencore/stats.cpp index f8cdc8fbb..c5187940e 100644 --- a/zencore/stats.cpp +++ b/zencore/stats.cpp @@ -1,10 +1,13 @@ // Copyright Epic Games, Inc. All Rights Reserved. #include "zencore/stats.h" -#include #include #include "zencore/timer.h" +#if ZEN_WITH_TESTS +# include +#endif + // // Derived from https://github.com/dln/medida/blob/master/src/medida/stats/ewma.cc // @@ -47,6 +50,8 @@ EWMA::Rate() const ////////////////////////////////////////////////////////////////////////// +#if ZEN_WITH_TESTS + TEST_CASE("Stats") { SUBCASE("Simple") @@ -70,4 +75,6 @@ stats_forcelink() { } +#endif + } // namespace zen -- cgit v1.2.3