From c5bd19e45edfa2989909f825269c462d1bf641b7 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 21 Mar 2024 14:02:58 -0700 Subject: [PATCH] std.Build.addTest: add doc comments closes #15009 --- lib/std/Build.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/std/Build.zig b/lib/std/Build.zig index 9ad4d0a69b..f850f73395 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -872,6 +872,14 @@ pub const TestOptions = struct { zig_lib_dir: ?LazyPath = null, }; +/// 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. pub fn addTest(b: *Build, options: TestOptions) *Step.Compile { return Step.Compile.create(b, .{ .name = options.name,