Skip to content

Commit ae1b1b4

Browse files
committed
tests: Fix duplicated-path-in-error fail with musl
musl's dlopen returns a different error than glibc, which contains the name of the file. This would cause the test to fail, since the filename would appear twice in the output (once in the error from rustc, once in the error message from musl). Split the expected test outputs for the different libc implementations. Signed-off-by: Jens Reidel <[email protected]>
1 parent cccf075 commit ae1b1b4

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

src/tools/compiletest/src/directives.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
973973
"only-mips64",
974974
"only-msp430",
975975
"only-msvc",
976+
"only-musl",
976977
"only-nightly",
977978
"only-nvptx64",
978979
"only-powerpc",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: couldn't load codegen backend /non-existing-one.so: Error loading shared library /non-existing-one.so: No such file or directory
2+

tests/ui/codegen/duplicated-path-in-error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
//@ revisions: musl gnu
12
//@ only-linux
3+
//@ ignore-cross-compile because this relies on host libc behaviour
24
//@ compile-flags: -Zcodegen-backend=/non-existing-one.so
5+
//@[gnu] only-gnu
6+
//@[musl] only-musl
37

48
// This test ensures that the error of the "not found dylib" doesn't duplicate
59
// the path of the dylib.
10+
//
11+
// glibc and musl have different dlopen error messages, so the expected error
12+
// message differs between the two.
613

714
fn main() {}
815

0 commit comments

Comments
 (0)