I need to debug this test run, but as there is no binary emitted, I don’t know if that’s possible. I know there is a emit-bin parameter for zig test, but because of the extra linking steps it complains if I try to run the test that way.
Is there perhaps something I can add to my build.zig to get it to write a binary for the tests being run? Or is there another option for debugging these tests?
If you just want a temporary solution without modifying build.zig, you can get the path to the test binary in the cache if you pass --verbose to zig build test
As a third approach, if you happen to use VSCode, you can install the Zig Language Extras plugin, and launch debugging of a single test from within the file. It has some limitations, mainly that the test name has to be “in quotes” for the regex to find it, but it’s great to have, I rely on it extensively.