diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-24 22:04:50 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-24 22:08:36 +0200 |
| commit | 89563f07e3956a44e37eb59e618d926bd401055c (patch) | |
| tree | 379396e9dae61764b0e9406ba33a4fd32807c5f7 /lib/std/Build/Step/Compile.zig | |
| parent | 22a6a5d93f000afd7e00450bb5a359f39bb598bf (diff) | |
| download | zig-89563f07e3956a44e37eb59e618d926bd401055c.tar.gz zig-89563f07e3956a44e37eb59e618d926bd401055c.zip | |
build: match and ignore /?/ in expected compile errors
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
| -rw-r--r-- | lib/std/Build/Step/Compile.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index fa5d66780e..752e403ca9 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -2410,6 +2410,19 @@ fn checkCompileErrors(self: *Compile) !void { continue; } } + // We scan for /?/ in expected line and if there is a match, we match everything + // up to and after /?/. + const expect_line_trim = mem.trim(u8, expect_line, " "); + if (mem.indexOf(u8, expect_line_trim, "/?/")) |exp_index| { + const actual_line_trim = mem.trim(u8, actual_line, " "); + const exp_lhs = expect_line_trim[0..exp_index]; + const exp_rhs = expect_line_trim[exp_index + "/?/".len ..]; + if (mem.startsWith(u8, actual_line_trim, exp_lhs) and mem.endsWith(u8, actual_line_trim, exp_rhs)) { + try expected_generated.appendSlice(actual_line); + try expected_generated.append('\n'); + continue; + } + } try expected_generated.appendSlice(expect_line); try expected_generated.append('\n'); } |
