diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/process.zig | 1 | ||||
| -rw-r--r-- | lib/std/testing.zig | 4 | ||||
| -rw-r--r-- | lib/test_runner.zig | 17 |
3 files changed, 0 insertions, 22 deletions
diff --git a/lib/std/process.zig b/lib/std/process.zig index d8604edab8..2c51ec2d60 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -822,7 +822,6 @@ test "args iterator" { const given_suffix = std.fs.path.basename(prog_name); try testing.expect(mem.eql(u8, expected_suffix, given_suffix)); - try testing.expect(it.skip()); // Skip over zig_exe_path, passed to the test runner try testing.expect(it.next() == null); try testing.expect(!it.skip()); } diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 67f6b33122..c71e2d39c9 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -22,10 +22,6 @@ pub var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); /// TODO https://github.com/ziglang/zig/issues/5738 pub var log_level = std.log.Level.warn; -/// This is available to any test that wants to execute Zig in a child process. -/// It will be the same executable that is running `zig test`. -pub var zig_exe_path: []const u8 = undefined; - /// This function is intended to be used only in tests. It prints diagnostics to stderr /// and then returns a test failure error when actual_error_union is not expected_error. pub fn expectError(expected_error: anyerror, actual_error_union: anytype) !void { diff --git a/lib/test_runner.zig b/lib/test_runner.zig index 8a3c1f0ca7..aafaf1b073 100644 --- a/lib/test_runner.zig +++ b/lib/test_runner.zig @@ -6,29 +6,12 @@ pub const io_mode: io.Mode = builtin.test_io_mode; var log_err_count: usize = 0; -var args_buffer: [std.fs.MAX_PATH_BYTES + std.mem.page_size]u8 = undefined; -var args_allocator = std.heap.FixedBufferAllocator.init(&args_buffer); - -fn processArgs() void { - const args = std.process.argsAlloc(args_allocator.allocator()) catch { - @panic("Too many bytes passed over the CLI to the test runner"); - }; - if (args.len != 2) { - const self_name = if (args.len >= 1) args[0] else if (builtin.os.tag == .windows) "test.exe" else "test"; - const zig_ext = if (builtin.os.tag == .windows) ".exe" else ""; - std.debug.print("Usage: {s} path/to/zig{s}\n", .{ self_name, zig_ext }); - @panic("Wrong number of command line arguments"); - } - std.testing.zig_exe_path = args[1]; -} - pub fn main() void { if (builtin.zig_backend != .stage1 and (builtin.zig_backend != .stage2_llvm or builtin.cpu.arch == .wasm32)) { return main2() catch @panic("test failure"); } - processArgs(); const test_fn_list = builtin.test_functions; var ok_count: usize = 0; var skip_count: usize = 0; |
