#How do I debug a specific test?

1 messages · Page 1 of 1 (latest)

fickle viper
brazen kindle
carmine helm
#

i often add a test-filter option to my build.zig:

test.filter = b.option([]const u8, "test-filter", "test filter");

then you can use from cli

$ zig build test -Dtest-filter="foo"
#

that should allow you to add a filter to your test command in launch.json

fickle viper
#

Thanks

#

But there's no option to do this at runtime, right?

#

It has to recompile

carmine helm
#

yes its a build time option. so basically comptime

fickle viper
#

Ok thanks

warm valley
#

Hi @fickle viper, you tagged this conversation in my message. I am trying to run a specific test in parse_float.zig.

Still cant do it, when I run zig test lib/std/std.zig --zig-lib-dir lib --test-filter "parseFloat"
It says All 59 tests passed! but when I edit something like remove a test the count still stays the same which tells me that its not working properly.

What am I doing wrong here?

fickle viper
#

There are multiple tests with that in the name, most likely

warm valley
#

got it