| ... | ... | @@ -660,20 +660,19 @@ pub fn addLinkTests( |
| 660 | 660 | |
| 661 | 661 | pub fn addCliTests(b: *std.Build) *Step { |
| 662 | 662 | const step = b.step("test-cli", "Test the command line interface"); |
| 663 | const s = std.fs.path.sep_str; |
| 663 | 664 | |
| 664 | 665 | { |
| 666 | |
| 665 | 667 | // Test `zig init-lib`. |
| 666 | 668 | const tmp_path = b.makeTempPath(); |
| 667 | 669 | const init_lib = b.addSystemCommand(&.{ b.zig_exe, "init-lib" }); |
| 668 | 670 | init_lib.cwd = tmp_path; |
| 669 | 671 | init_lib.setName("zig init-lib"); |
| 670 | 672 | init_lib.expectStdOutEqual(""); |
| 671 | | init_lib.expectStdErrEqual( |
| 672 | | \\info: Created build.zig |
| 673 | | \\info: Created src/main.zig |
| 674 | | \\info: Next, try `zig build --help` or `zig build test` |
| 675 | | \\ |
| 676 | | ); |
| 673 | init_lib.expectStdErrEqual("info: Created build.zig\n" ++ |
| 674 | "info: Created src" ++ s ++ "main.zig\n" ++ |
| 675 | "info: Next, try `zig build --help` or `zig build test`\n"); |
| 677 | 676 | |
| 678 | 677 | const run_test = b.addSystemCommand(&.{ b.zig_exe, "build", "test" }); |
| 679 | 678 | run_test.cwd = tmp_path; |
| ... | ... | @@ -694,15 +693,11 @@ pub fn addCliTests(b: *std.Build) *Step { |
| 694 | 693 | init_exe.cwd = tmp_path; |
| 695 | 694 | init_exe.setName("zig init-exe"); |
| 696 | 695 | init_exe.expectStdOutEqual(""); |
| 697 | | init_exe.expectStdErrEqual( |
| 698 | | \\info: Created build.zig |
| 699 | | \\info: Created src/main.zig |
| 700 | | \\info: Next, try `zig build --help` or `zig build run` |
| 701 | | \\ |
| 702 | | ); |
| 696 | init_exe.expectStdErrEqual("info: Created build.zig\n" ++ |
| 697 | "info: Created src" ++ s ++ "main.zig\n" ++ |
| 698 | "info: Next, try `zig build --help` or `zig build run`\n"); |
| 703 | 699 | |
| 704 | 700 | // Test missing output path. |
| 705 | | const s = std.fs.path.sep_str; |
| 706 | 701 | const bad_out_arg = "-femit-bin=does" ++ s ++ "not" ++ s ++ "exist" ++ s ++ "foo.exe"; |
| 707 | 702 | const ok_src_arg = "src" ++ s ++ "main.zig"; |
| 708 | 703 | const expected = "error: unable to open output directory 'does" ++ s ++ "not" ++ s ++ "exist': FileNotFound\n"; |
| ... | ... | @@ -785,7 +780,6 @@ pub fn addCliTests(b: *std.Build) *Step { |
| 785 | 780 | // owners. |
| 786 | 781 | const tmp_path = b.makeTempPath(); |
| 787 | 782 | const unformatted_code = " // no reason for indent"; |
| 788 | | const s = std.fs.path.sep_str; |
| 789 | 783 | |
| 790 | 784 | var dir = std.fs.cwd().openDir(tmp_path, .{}) catch @panic("unhandled"); |
| 791 | 785 | defer dir.close(); |