master
 1const std = @import("std");
 2
 3pub fn build(b: *std.Build) void {
 4    const test_step = b.step("test", "Test it");
 5    b.default_step = test_step;
 6
 7    const optimize: std.builtin.OptimizeMode = .Debug;
 8
 9    const exe = b.addExecutable(.{
10        .name = "test",
11        .root_module = b.createModule(.{
12            .root_source_file = b.path("test.zig"),
13            .optimize = optimize,
14            .target = b.graph.host,
15        }),
16    });
17    exe.root_module.addAnonymousImport("my_pkg", .{ .root_source_file = b.path("pkg.zig") });
18
19    const run = b.addRunArtifact(exe);
20    test_step.dependOn(&run.step);
21}