put tests behind version flag

This commit is contained in:
Matthew 2025-12-10 17:25:01 +11:00
parent 60b4e0cb27
commit 91e83eea1d
5 changed files with 6 additions and 6 deletions

View File

@ -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];

2
math.d
View File

@ -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;

View File

@ -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);

View File

@ -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

2
util.d
View File

@ -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;