diff options
| author | Cody Tapscott <topolarity@tapscott.me> | 2022-02-05 09:09:55 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-02-06 22:21:46 -0700 |
| commit | c1cf158729f4d726639a5695754957f9f45f89da (patch) | |
| tree | c876a91ac6f02f3e7bdc9097c742cd609a3b6014 /test/tests.zig | |
| parent | 5065830aa007c374c382be9e80ba924df6cecc78 (diff) | |
| download | zig-c1cf158729f4d726639a5695754957f9f45f89da.tar.gz zig-c1cf158729f4d726639a5695754957f9f45f89da.zip | |
Replace argvCmd with std.mem.join
Diffstat (limited to 'test/tests.zig')
| -rw-r--r-- | test/tests.zig | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/test/tests.zig b/test/tests.zig index bd6c82cbb7..5b15da2bcb 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -28,17 +28,6 @@ pub const TranslateCContext = @import("src/translate_c.zig").TranslateCContext; pub const RunTranslatedCContext = @import("src/run_translated_c.zig").RunTranslatedCContext; pub const CompareOutputContext = @import("src/compare_output.zig").CompareOutputContext; -fn argvCmd(allocator: Allocator, argv: []const []const u8) ![]u8 { - var cmd = std.ArrayList(u8).init(allocator); - defer cmd.deinit(); - for (argv[0 .. argv.len - 1]) |arg| { - try cmd.appendSlice(arg); - try cmd.append(' '); - } - try cmd.appendSlice(argv[argv.len - 1]); - return cmd.toOwnedSlice(); -} - const TestTarget = struct { target: CrossTarget = @as(CrossTarget, .{}), mode: std.builtin.Mode = .Debug, @@ -736,7 +725,7 @@ pub const StackTracesContext = struct { std.debug.print("Test {d}/{d} {s}...", .{ self.test_index + 1, self.context.test_index, self.name }); if (!std.process.can_spawn) { - const cmd = try argvCmd(b.allocator, args.items); + const cmd = try std.mem.join(b.allocator, " ", args.items); std.debug.print("the following command cannot be executed ({s} does not support spawning a child process):\n{s}", .{ @tagName(builtin.os.tag), cmd }); b.allocator.free(cmd); return ExecError.ExecNotSupported; |
