diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-05-24 08:22:47 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-05-27 20:56:48 -0700 |
| commit | f97c2f28fdc3061bc7e30ccfcafaccbee77993b6 (patch) | |
| tree | a2c4165829d84b35df23346b1808a43e0cccec41 /lib/std/Build/Step/Run.zig | |
| parent | f6873c6b00544923d5699737651f2bc4fe29fd06 (diff) | |
| download | zig-f97c2f28fdc3061bc7e30ccfcafaccbee77993b6.tar.gz zig-f97c2f28fdc3061bc7e30ccfcafaccbee77993b6.zip | |
update the codebase for the new std.Progress API
Diffstat (limited to 'lib/std/Build/Step/Run.zig')
| -rw-r--r-- | lib/std/Build/Step/Run.zig | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/std/Build/Step/Run.zig b/lib/std/Build/Step/Run.zig index fec5b5ab67..d49d0b3ce2 100644 --- a/lib/std/Build/Step/Run.zig +++ b/lib/std/Build/Step/Run.zig @@ -574,7 +574,7 @@ const IndexedOutput = struct { tag: @typeInfo(Arg).Union.tag_type.?, output: *Output, }; -fn make(step: *Step, prog_node: *std.Progress.Node) !void { +fn make(step: *Step, prog_node: std.Progress.Node) !void { const b = step.owner; const arena = b.allocator; const run: *Run = @fieldParentPtr("step", step); @@ -878,7 +878,7 @@ fn runCommand( argv: []const []const u8, has_side_effects: bool, output_dir_path: []const u8, - prog_node: *std.Progress.Node, + prog_node: std.Progress.Node, ) !void { const step = &run.step; const b = step.owner; @@ -1195,7 +1195,7 @@ fn spawnChildAndCollect( run: *Run, argv: []const []const u8, has_side_effects: bool, - prog_node: *std.Progress.Node, + prog_node: std.Progress.Node, ) !ChildProcResult { const b = run.step.owner; const arena = b.allocator; @@ -1235,6 +1235,10 @@ fn spawnChildAndCollect( child.stdin_behavior = .Pipe; } + if (run.stdio != .zig_test) { + child.progress_node = prog_node.start("", 0); + } + try child.spawn(); var timer = try std.time.Timer.start(); @@ -1264,7 +1268,7 @@ const StdIoResult = struct { fn evalZigTest( run: *Run, child: *std.process.Child, - prog_node: *std.Progress.Node, + prog_node: std.Progress.Node, ) !StdIoResult { const gpa = run.step.owner.allocator; const arena = run.step.owner.allocator; @@ -1291,7 +1295,7 @@ fn evalZigTest( var metadata: ?TestMetadata = null; var sub_prog_node: ?std.Progress.Node = null; - defer if (sub_prog_node) |*n| n.end(); + defer if (sub_prog_node) |n| n.end(); poll: while (true) { while (stdout.readableLength() < @sizeOf(Header)) { @@ -1406,7 +1410,7 @@ const TestMetadata = struct { expected_panic_msgs: []const u32, string_bytes: []const u8, next_index: u32, - prog_node: *std.Progress.Node, + prog_node: std.Progress.Node, fn testName(tm: TestMetadata, index: u32) []const u8 { return std.mem.sliceTo(tm.string_bytes[tm.names[index]..], 0); @@ -1421,7 +1425,7 @@ fn requestNextTest(in: fs.File, metadata: *TestMetadata, sub_prog_node: *?std.Pr if (metadata.expected_panic_msgs[i] != 0) continue; const name = metadata.testName(i); - if (sub_prog_node.*) |*n| n.end(); + if (sub_prog_node.*) |n| n.end(); sub_prog_node.* = metadata.prog_node.start(name, 0); try sendRunTestMessage(in, i); |
