#Get `zig build test` to run tests for modules that are imported into the main module file?

1 messages · Page 1 of 1 (latest)

charred timber
#

Looks like I can get it to run tests for a module by doing this:

usingnamespace @import("png.zig");

but not something like this:

pub const png = @import("png.zig");

Do I have to have a test steps for each source file?

oblique stump
#
test {
    _ = @import("png.zig");
}

I believe

charred timber
#

Yeah that works!

#

Man I wish I knew that a few days ago lol.

#

So basically the import is pulling the tests into scope?

#

You can have nested tests???