aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-02-14 16:42:42 -0500
committerDave Gauer <dave@ratfactor.com>2021-02-14 16:45:18 -0500
commit95c8ea3cb3bde9427e2364e450a6cf443cdaba5e (patch)
tree1e2e3c80c5c83da807eb871453935ae442eb6bdf /build.zig
parent0d618f4dda5e8edaf42f84f304f36239e339b0e5 (diff)
downloadziglings-95c8ea3cb3bde9427e2364e450a6cf443cdaba5e.tar.gz
ziglings-95c8ea3cb3bde9427e2364e450a6cf443cdaba5e.tar.bz2
ziglings-95c8ea3cb3bde9427e2364e450a6cf443cdaba5e.tar.xz
ziglings-95c8ea3cb3bde9427e2364e450a6cf443cdaba5e.zip
Make "check and halt" the default for zig build NN (#15)
The "start with NN" action is now NN_start. Also formatting output for improved clarity (hopefully).
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/build.zig b/build.zig
index 916f1a7..e80e98e 100644
--- a/build.zig
+++ b/build.zig
@@ -324,7 +324,7 @@ pub fn build(b: *Builder) void {
\\
, .{});
- const verify_all = b.step("ziglings", "Verify all ziglings");
+ const verify_all = b.step("ziglings", "Check all ziglings");
verify_all.dependOn(&header_step.step);
b.default_step = verify_all;
@@ -342,21 +342,21 @@ pub fn build(b: *Builder) void {
const key = ex.key();
- const named_test = b.step(b.fmt("{s}_test", .{key}), b.fmt("Run {s} without verifying output", .{ex.main_file}));
+ const named_test = b.step(b.fmt("{s}_test", .{key}), b.fmt("Run {s} without checking output", .{ex.main_file}));
const run_step = build_step.run();
named_test.dependOn(&run_step.step);
const named_install = b.step(b.fmt("{s}_install", .{key}), b.fmt("Install {s} to zig-cache/bin", .{ex.main_file}));
named_install.dependOn(&build_step.install_step.?.step);
- const named_verify = b.step(b.fmt("{s}_only", .{key}), b.fmt("Verify {s} only", .{ex.main_file}));
+ const named_verify = b.step(key, b.fmt("Check {s} only", .{ex.main_file}));
named_verify.dependOn(&verify_step.step);
const chain_verify = b.allocator.create(Step) catch unreachable;
chain_verify.* = Step.initNoOp(.Custom, b.fmt("chain {s}", .{key}), b.allocator);
chain_verify.dependOn(&verify_step.step);
- const named_chain = b.step(key, b.fmt("Verify all solutions starting at {s}", .{ex.main_file}));
+ const named_chain = b.step(b.fmt("{s}_start", .{key}), b.fmt("Check all solutions starting at {s}", .{ex.main_file}));
named_chain.dependOn(&header_step.step);
named_chain.dependOn(chain_verify);
@@ -390,7 +390,7 @@ const ZiglingStep = struct {
const self = @fieldParentPtr(@This(), "step", step);
self.makeInternal() catch {
if (self.exercise.hint.len > 0) {
- print("\n{s}hint: {s}{s}", .{ bold_text, self.exercise.hint, reset_text });
+ print("\n{s}HINT: {s}{s}", .{ bold_text, self.exercise.hint, reset_text });
}
print("\n{s}Edit exercises/{s} and run this again.{s}", .{ red_text, self.exercise.main_file, reset_text });
@@ -404,7 +404,7 @@ const ZiglingStep = struct {
const exe_file = try self.doCompile();
- print("Verifying {s}...\n", .{self.exercise.main_file});
+ print("Checking {s}...\n", .{self.exercise.main_file});
const cwd = self.builder.build_root;
@@ -471,7 +471,7 @@ const ZiglingStep = struct {
return error.InvalidOutput;
}
- print("{s}{s}{s}\n", .{ green_text, output, reset_text });
+ print("{s}PASSED: {s}{s}\n", .{ green_text, output, reset_text });
}
// The normal compile step calls os.exit, so we can't use it as a library :(