diff options
| author | Stefan Boberg <[email protected]> | 2021-09-20 10:15:12 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-20 10:15:12 +0200 |
| commit | 8d3024a7e09246e44bf6d9ea14a36e6b03032e85 (patch) | |
| tree | c18c2536d108378e5cddcac21398efd8d28e437d /zencore/memory.cpp | |
| parent | Added testing.h to wrap doctest.h (diff) | |
| download | zen-8d3024a7e09246e44bf6d9ea14a36e6b03032e85.tar.xz zen-8d3024a7e09246e44bf6d9ea14a36e6b03032e85.zip | |
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.
Diffstat (limited to 'zencore/memory.cpp')
| -rw-r--r-- | zencore/memory.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/zencore/memory.cpp b/zencore/memory.cpp index 26c8321e5..613b6ba67 100644 --- a/zencore/memory.cpp +++ b/zencore/memory.cpp @@ -2,6 +2,7 @@ #include <zencore/intmath.h> #include <zencore/memory.h> +#include <zencore/testing.h> #ifdef ZEN_PLATFORM_WINDOWS # include <malloc.h> @@ -9,8 +10,6 @@ # include <cstdlib> #endif -#include <doctest/doctest.h> - namespace zen { ////////////////////////////////////////////////////////////////////////// @@ -147,6 +146,8 @@ ChunkingLinearAllocator::Alloc(size_t Size, size_t Alignment) // Unit tests // +#if ZEN_WITH_TESTS + TEST_CASE("ChunkingLinearAllocator") { ChunkingLinearAllocator Allocator(4096); @@ -194,4 +195,6 @@ memory_forcelink() { } +#endif + } // namespace zen |