| author | |
| committer | |
| log | 22661f3d67251688a1fabf9e5fe65210ce284b9f |
| tree | 713dbd96a58ada0527b2668246df813f40a09cf0 |
| parent | 31d70cb1e11cf480f4a45afdff20e4adf0d6068b |
2 files changed, 13 insertions(+), 1 deletions(-)
lib/std/Build/Step/Compile.zig+12| ... | ... | @@ -235,6 +235,7 @@ sanitize_coverage_trace_pc_guard: ?bool = null, |
| 235 | 235 | pub const ExpectedCompileErrors = union(enum) { |
| 236 | 236 | contains: []const u8, |
| 237 | 237 | exact: []const []const u8, |
| 238 | starts_with: []const u8, | |
| 238 | 239 | }; |
| 239 | 240 | |
| 240 | 241 | pub const Entry = union(enum) { |
| ... | ... | @@ -1958,6 +1959,17 @@ fn checkCompileErrors(compile: *Compile) !void { |
| 1958 | 1959 | |
| 1959 | 1960 | // TODO merge this with the testing.expectEqualStrings logic, and also CheckFile |
| 1960 | 1961 | switch (expect_errors) { |
| 1962 | .starts_with => |expect_starts_with| { | |
| 1963 | if (std.mem.startsWith(u8, actual_stderr, expect_starts_with)) return; | |
| 1964 | return compile.step.fail( | |
| 1965 | \\ | |
| 1966 | \\========= should start with: ============ | |
| 1967 | \\{s} | |
| 1968 | \\========= but not found: ================ | |
| 1969 | \\{s} | |
| 1970 | \\========================================= | |
| 1971 | , .{ expect_starts_with, actual_stderr }); | |
| 1972 | }, | |
| 1961 | 1973 | .contains => |expect_line| { |
| 1962 | 1974 | while (actual_line_it.next()) |actual_line| { |
| 1963 | 1975 | if (!matchCompileError(actual_line, expect_line)) continue; |
test/link/elf.zig+1-1| ... | ... | @@ -3916,7 +3916,7 @@ fn testUnknownFileTypeError(b: *Build, opts: Options) *Step { |
| 3916 | 3916 | // "note: while parsing /?/liba.dylib", |
| 3917 | 3917 | // } }); |
| 3918 | 3918 | expectLinkErrors(exe, test_step, .{ |
| 3919 | .contains = "error: invalid token in LD script: '\\x00\\x00\\x00\\x0c\\x00\\x00\\x00/usr/lib/dyld\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0d' (0:1069)", | |
| 3919 | .starts_with = "error: invalid token in LD script: '\\x00\\x00\\x00\\x0c\\x00\\x00\\x00/usr/lib/dyld\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0d' (", | |
| 3920 | 3920 | }); |
| 3921 | 3921 | |
| 3922 | 3922 | return test_step; |