| ... | ... | @@ -656,10 +656,10 @@ pub const TestContext = struct { |
| 656 | 656 | |
| 657 | 657 | const Strategy = enum { |
| 658 | 658 | /// Execute tests as independent compilations, unless they are explicitly |
| 659 | | /// incremental ("foo.1.zig", "foo.2.zig", etc.) |
| 659 | /// incremental ("foo.0.zig", "foo.1.zig", etc.) |
| 660 | 660 | independent, |
| 661 | 661 | /// Execute all tests as incremental updates to a single compilation. Explicitly |
| 662 | | /// incremental tests ("foo.1.zig", "foo.2.zig", etc.) still execute in order |
| 662 | /// incremental tests ("foo.0.zig", "foo.1.zig", etc.) still execute in order |
| 663 | 663 | incremental, |
| 664 | 664 | }; |
| 665 | 665 | |
| ... | ... | @@ -716,8 +716,8 @@ pub const TestContext = struct { |
| 716 | 716 | }; |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | | /// Sort test filenames in-place, so that incremental test cases ("foo.1.zig", |
| 720 | | /// "foo.2.zig", etc.) are contiguous and appear in numerical order. |
| 719 | /// Sort test filenames in-place, so that incremental test cases ("foo.0.zig", |
| 720 | /// "foo.1.zig", etc.) are contiguous and appear in numerical order. |
| 721 | 721 | fn sortTestFilenames( |
| 722 | 722 | filenames: [][]const u8, |
| 723 | 723 | ) void { |
| ... | ... | @@ -804,8 +804,8 @@ pub const TestContext = struct { |
| 804 | 804 | } else { |
| 805 | 805 | |
| 806 | 806 | // This is not the same test sequence, so the new file must be the first file |
| 807 | | // in a new sequence ("*.1.zig") or an independent test file ("*.zig") |
| 808 | | if (new_parts.test_index != null and new_parts.test_index.? != 1) return error.InvalidIncrementalTestIndex; |
| 807 | // in a new sequence ("*.0.zig") or an independent test file ("*.zig") |
| 808 | if (new_parts.test_index != null and new_parts.test_index.? != 0) return error.InvalidIncrementalTestIndex; |
| 809 | 809 | |
| 810 | 810 | if (strategy == .independent) |
| 811 | 811 | opt_case = null; // Generate a new independent test case for this update |
| ... | ... | @@ -1239,7 +1239,7 @@ pub const TestContext = struct { |
| 1239 | 1239 | if (all_errors.list.len != 0) { |
| 1240 | 1240 | print( |
| 1241 | 1241 | "\nCase '{s}': unexpected errors at update_index={d}:\n{s}\n", |
| 1242 | | .{ case.name, update_index + 1, hr }, |
| 1242 | .{ case.name, update_index, hr }, |
| 1243 | 1243 | ); |
| 1244 | 1244 | for (all_errors.list) |err_msg| { |
| 1245 | 1245 | switch (err_msg) { |
| ... | ... | @@ -1401,7 +1401,7 @@ pub const TestContext = struct { |
| 1401 | 1401 | } |
| 1402 | 1402 | |
| 1403 | 1403 | if (any_failed) { |
| 1404 | | print("\nupdate_index={d}\n", .{update_index + 1}); |
| 1404 | print("\nupdate_index={d}\n", .{update_index}); |
| 1405 | 1405 | return error.WrongCompileErrors; |
| 1406 | 1406 | } |
| 1407 | 1407 | }, |
| ... | ... | @@ -1508,7 +1508,7 @@ pub const TestContext = struct { |
| 1508 | 1508 | .cwd = tmp_dir_path, |
| 1509 | 1509 | }) catch |err| { |
| 1510 | 1510 | print("\nupdate_index={d} The following command failed with {s}:\n", .{ |
| 1511 | | update_index + 1, @errorName(err), |
| 1511 | update_index, @errorName(err), |
| 1512 | 1512 | }); |
| 1513 | 1513 | dumpArgs(argv.items); |
| 1514 | 1514 | return error.ChildProcessExecution; |