From 7461890cb125559401758849fff289223b4b3c13 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 24 Oct 2021 22:43:34 -0700 Subject: [PATCH] build.zig- make the run step to run the tests --- build.zig | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/build.zig b/build.zig index 8a3036d41ff085d7245ec00ed051b22ba68b95c2..ef7b33767c2867a43dff8c20f891ae793315af7c 100644 --- a/build.zig +++ b/build.zig @@ -2,32 +2,9 @@ const std = @import("std"); const deps = @import("./deps.zig"); pub fn build(b: *std.build.Builder) void { - const target = b.standardTargetOptions(.{}); + const t = b.addTest("main.zig"); + deps.addAllTo(t); - const mode = b.standardReleaseOptions(); - - const exe = b.addExecutable("zig-time", "main.zig"); - exe.setTarget(target); - exe.setBuildMode(mode); - deps.addAllTo(exe); - exe.install(); - - { - const run_cmd = exe.run(); - run_cmd.step.dependOn(b.getInstallStep()); - if (b.args) |args| { - run_cmd.addArgs(args); - } - - const run_step = b.step("run", "Run the app"); - run_step.dependOn(&run_cmd.step); - } - - { - const t = b.addTest("main.zig"); - deps.addAllTo(t); - - const t_step = b.step("test", ""); - t_step.dependOn(&t.step); - } + const t_step = b.step("run", "Run all the tests."); + t_step.dependOn(&t.step); } -- 2.54.0