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/iobuffer.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/iobuffer.cpp')
| -rw-r--r-- | zencore/iobuffer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp index ee06f379e..bcecc768f 100644 --- a/zencore/iobuffer.cpp +++ b/zencore/iobuffer.cpp @@ -2,13 +2,14 @@ #include <zencore/iobuffer.h> -#include <doctest/doctest.h> -#include <memory.h> #include <zencore/filesystem.h> #include <zencore/fmtutils.h> #include <zencore/logging.h> #include <zencore/memory.h> +#include <zencore/testing.h> #include <zencore/thread.h> + +#include <memory.h> #include <system_error> #include <atlfile.h> @@ -382,6 +383,8 @@ IoBufferBuilder::MakeFromTemporaryFile(const wchar_t* FileName) ////////////////////////////////////////////////////////////////////////// +#if ZEN_WITH_TESTS + void iobuffer_forcelink() { @@ -394,4 +397,6 @@ TEST_CASE("IoBuffer") zen::IoBuffer buffer3(buffer2, 0, buffer2.Size()); } +#endif + } // namespace zen |