In this example I am using an executable for fuzzing, the output is at zig-out/cover, the --clean flag erases previous coverage runs since I don’t merge the results and the flag: --include-pattern=src/ includes only my source code.
It’s the same with C. perf just works for linux and normally you can use your platform specific profiler with zig.
You can use lldb or gdb, or editors such as visual studio code to drive the debuggers from gui.
Unfortunately it does not work. I’m testing a file in the standard library, so after 19079 you need to test lib/std/std.zig and using test-filter to select the tests to run.
I tried kcov filters, but I was unable to make kcov exclude all the files except the file I want to test.
I tried first to --exclude-path lib followed by --include-path lib/std/<file>.zig, but it results in an empty test coverage.
But thanks for the hint about --clean.
Zig does have pretty printers for gdb and lldb, but for tracy, the two current bindings are 2 years old. Should I use perf, instead (I’m on Linux)?