test/link/elf: make invalid input file test less janky

This commit is contained in:
Jakub Konka 2024-01-13 12:49:54 +01:00
parent 56303d770e
commit aa50bca151

View file

@ -3609,12 +3609,17 @@ fn testUnknownFileTypeError(b: *Build, opts: Options) *Step {
exe.linkLibrary(dylib);
exe.linkLibC();
expectLinkErrors(exe, test_step, .{ .exact = &.{
"invalid token in LD script: '\\x00\\x00\\x00\\x0c\\x00\\x00\\x00/usr/lib/dyld\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0d' (0:829)",
"note: while parsing /?/liba.dylib",
"unexpected error: parsing input file failed with error InvalidLdScript",
"note: while parsing /?/liba.dylib",
} });
// TODO: improve the test harness to be able to selectively match lines in error output
// while avoiding jankiness
// expectLinkErrors(exe, test_step, .{ .exact = &.{
// "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:989)",
// "note: while parsing /?/liba.dylib",
// "error: unexpected error: parsing input file failed with error InvalidLdScript",
// "note: while parsing /?/liba.dylib",
// } });
expectLinkErrors(exe, test_step, .{
.contains = "error: unexpected error: parsing input file failed with error InvalidLdScript",
});
return test_step;
}