Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

addTest

Public Function
std.Build.addTest
pub fn addTest(b: *Build, options: TestOptions) *Step.Compile

Creates an executable containing unit tests.

Equivalent to running the command zig test --test-no-exec ....

This step does not run the unit tests. Typically, the result of this function will be passed to addRunArtifact, creating a Step.Run. These two steps are separated because they are independently configured and cached.

Params

File

Build.zig:674
674
675
676
677
678
679
680
681
682
683
684
685
686
pub fn addTest(b: *Build, options: TestOptions) *Step.Compile {
    return .create(b, .{
        .name = options.name,
        .kind = if (options.emit_object) .test_obj else .@"test",
        .root_module = options.root_module,
        .max_rss = options.max_rss,
        .filters = b.graph.dupeStrings(options.filters),
        .test_runner = options.test_runner,
        .use_llvm = options.use_llvm,
        .use_lld = options.use_lld,
        .zig_lib_dir = options.zig_lib_dir,
    });
}