From 91e83eea1dc2f295726fccd551df7f3d65154de1 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 10 Dec 2025 17:25:01 +1100 Subject: [PATCH] put tests behind version flag --- alloc.d | 2 +- math.d | 2 +- platform.d | 4 ++-- test.sh | 2 +- util.d | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/alloc.d b/alloc.d index 2c2735a..1a3d607 100644 --- a/alloc.d +++ b/alloc.d @@ -426,7 +426,7 @@ ScratchAlloc(T)(u64 count, T set) return arr; } -unittest +version(DLIB_TEST) unittest { { u64[5] arr = [1, 2, 3, 4, 5]; diff --git a/math.d b/math.d index 5568127..0784d69 100644 --- a/math.d +++ b/math.d @@ -956,7 +956,7 @@ Remap(f32 v, f32 in_min, f32 in_max, f32 out_min, f32 out_max) return Lerp(out_min, out_max, t); } -unittest +version(DLIB_TEST) unittest { enum FLOAT_MAX = f32.max; enum FLOAT_MIN = -f32.max; diff --git a/platform.d b/platform.d index 7beeb0c..03c3974 100644 --- a/platform.d +++ b/platform.d @@ -1775,7 +1775,7 @@ SetEventType(WatchEvent* ev, u32 mask) } } -unittest +version(DLIB_TEST) unittest { import std.stdio; import std.file : Remove = remove; @@ -1928,7 +1928,7 @@ LoadFile(Arena* arena, string file_name) return data; } -unittest +version(DLIB_TEST) unittest { { // Keys u8 ch = InputToChar(Input.NumEight); diff --git a/test.sh b/test.sh index 36bbaa8..5c9e3e7 100755 --- a/test.sh +++ b/test.sh @@ -4,7 +4,7 @@ name="Test_Runner" /bin/bash ./build.sh build -ldc2 platform.d aliases.d math.d util.d alloc.d assets.d external/xxhash/xxhash.d build/libcglm.a -Xcc=-mno-sse -P-I/usr/include/freetype2 -L-lfreetype --main --unittest -g --of=$name +ldc2 platform.d aliases.d math.d util.d alloc.d assets.d external/xxhash/xxhash.d build/libcglm.a -d-version=DLIB_TEST -Xcc=-mno-sse -P-I/usr/include/freetype2 -L-lfreetype --main --unittest -g --of=$name rm $name.o ./$name diff --git a/util.d b/util.d index 2cce492..914b26b 100644 --- a/util.d +++ b/util.d @@ -997,7 +997,7 @@ Embed(string file_name) return cast(u8[])read(file_name); } -unittest +version(DLIB_TEST) unittest { { // Singly Linked List SLList!(u32) list;