Given that compiling in Debug or ReleaseFast mode may yield different results, I wanted to check if my library code works correctly and catch any bugs by using tests.
However, I couldn't find any option to tell tests to be compiled and run in ReleaseFast mode. I assume they are all running on Debug mode by default.
The options are exactly the same as if you were simply compiling the code.
Using the build system:
zig build test -Doptimize=ReleaseFastWithout the build system:
zig test ./test.zig -O ReleaseFastAs a proof of concept, this fails in
Debug, but works inReleaseFast:And here is one that fails in
ReleaseFastbut works inDebug: