Zig 0.17.0-dev (Split by item)

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 library itself.

addTest

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.

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

File

lib/std/Build.zig:827

Code

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.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,
    });
}