aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-20 10:10:00 +0200
committerStefan Boberg <[email protected]>2021-09-20 10:10:00 +0200
commitd60c16b89e5e31eca2dc2b61226a32d317f1a1ad (patch)
tree2ba5b9d9777872e61b9b23f05bb300da76b30b07
parentMerge branch 'main' of https://github.com/EpicGames/zen (diff)
downloadzen-d60c16b89e5e31eca2dc2b61226a32d317f1a1ad.tar.xz
zen-d60c16b89e5e31eca2dc2b61226a32d317f1a1ad.zip
Added testing.h to wrap doctest.h
Provides no real abstraction right now but may in the future. This is introduced primarily to enable centralised configuration of whether tests should be included or not
-rw-r--r--xmake.lua6
-rw-r--r--zencore/include/zencore/testing.h11
-rw-r--r--zencore/zencore.vcxproj1
-rw-r--r--zencore/zencore.vcxproj.filters1
4 files changed, 19 insertions, 0 deletions
diff --git a/xmake.lua b/xmake.lua
index 8288963e0..17b10d28d 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -35,6 +35,12 @@ if is_mode("debug") then
add_defines("DEBUG")
end
+if is_mode("debug") then
+ add_defines("ZEN_WITH_TESTS=1")
+else
+ add_defines("ZEN_WITH_TESTS=0")
+end
+
if is_os("windows") then
add_defines("_CRT_SECURE_NO_WARNINGS", "_UNICODE", "UNICODE", "_WIN32_WINNT=0x0A00")
end
diff --git a/zencore/include/zencore/testing.h b/zencore/include/zencore/testing.h
new file mode 100644
index 000000000..75efb06e2
--- /dev/null
+++ b/zencore/include/zencore/testing.h
@@ -0,0 +1,11 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#ifndef ZEN_WITH_TESTS
+# define ZEN_WITH_TESTS 1
+#endif
+
+#if ZEN_WITH_TESTS
+# include <doctest/doctest.h>
+#endif
diff --git a/zencore/zencore.vcxproj b/zencore/zencore.vcxproj
index 59b0bafcc..46ec02892 100644
--- a/zencore/zencore.vcxproj
+++ b/zencore/zencore.vcxproj
@@ -142,6 +142,7 @@
<ClInclude Include="include\zencore\streamutil.h" />
<ClInclude Include="include\zencore\string.h" />
<ClInclude Include="include\zencore\targetver.h" />
+ <ClInclude Include="include\zencore\testing.h" />
<ClInclude Include="include\zencore\testutils.h" />
<ClInclude Include="include\zencore\thread.h" />
<ClInclude Include="include\zencore\timer.h" />
diff --git a/zencore/zencore.vcxproj.filters b/zencore/zencore.vcxproj.filters
index 6c6b308f8..b09eb1b73 100644
--- a/zencore/zencore.vcxproj.filters
+++ b/zencore/zencore.vcxproj.filters
@@ -43,6 +43,7 @@
<ClInclude Include="include\zencore\logging.h" />
<ClInclude Include="include\zencore\session.h" />
<ClInclude Include="include\zencore\testutils.h" />
+ <ClInclude Include="include\zencore\testing.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="snapshot_manifest.cpp" />