diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-04-28 14:11:53 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-04-28 14:12:32 -0700 |
| commit | c5e847744c82953d44189a2c7094c8257fdf5b09 (patch) | |
| tree | 26b3f4864583249c3f97ccda0efb1f48bf83fe90 /lib/std/testing.zig | |
| parent | 091fe78337dc3ca340fdf74ca6c1a58c5e666626 (diff) | |
| download | zig-c5e847744c82953d44189a2c7094c8257fdf5b09.tar.gz zig-c5e847744c82953d44189a2c7094c8257fdf5b09.zip | |
Revert "Merge pull request #11214 from iddev5/ay-build-runner"
This reverts commit 75c9936737a6ba991d4ef187ddc9d51bc0ad0998, reversing
changes made to 7f13f5cd5f5a518638b15d7225eae2d88ec1efb5.
I don't think `runZigBuild` belongs in std.testing. We already have
`test/standalone/*` for this.
Additionally test names should explain what they are testing rather than
referencing GitHub issue numbers.
Diffstat (limited to 'lib/std/testing.zig')
| -rw-r--r-- | lib/std/testing.zig | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 016e84acd8..cfdf300c04 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -450,36 +450,6 @@ pub fn buildExe(zigexec: []const u8, zigfile: []const u8, binfile: []const u8) ! try expectEqual(ret_val, .{ .Exited = 0 }); } -/// Spawns a zig build runner process 'zigexec build subcmd' and -/// expects success -/// If specified, runs zig build in the cwd path -/// If specified, uses the specified lib_dir for zig standard library -/// instead of compiler's default library directory -pub fn runZigBuild(zigexec: []const u8, options: struct { - subcmd: ?[]const u8 = null, - cwd: ?[]const u8 = null, - lib_dir: ?[]const u8 = null, -}) !std.ChildProcess.ExecResult { - var args = std.ArrayList([]const u8).init(allocator); - defer args.deinit(); - - try args.appendSlice(&.{ zigexec, "build" }); - if (options.subcmd) |subcmd| try args.append(subcmd); - if (options.lib_dir) |lib_dir| try args.append(lib_dir); - - var result = try std.ChildProcess.exec(.{ - .allocator = allocator, - .argv = args.items, - .cwd = if (options.cwd) |c| c else null, - }); - errdefer { - allocator.free(result.stdout); - allocator.free(result.stderr); - } - - return result; -} - test "expectEqual nested array" { const a = [2][2]f32{ [_]f32{ 1.0, 0.0 }, |
