From ae1b1b4f8a9a1cd012cd7db944bbfa2adae703cb Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Tue, 10 Jun 2025 18:36:22 +0200 Subject: 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 --- tests/ui/codegen/duplicated-path-in-error.gnu.stderr | 2 ++ tests/ui/codegen/duplicated-path-in-error.musl.stderr | 2 ++ tests/ui/codegen/duplicated-path-in-error.rs | 7 +++++++ tests/ui/codegen/duplicated-path-in-error.stderr | 2 -- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/ui/codegen/duplicated-path-in-error.gnu.stderr create mode 100644 tests/ui/codegen/duplicated-path-in-error.musl.stderr delete mode 100644 tests/ui/codegen/duplicated-path-in-error.stderr (limited to 'tests/ui/codegen') diff --git a/tests/ui/codegen/duplicated-path-in-error.gnu.stderr b/tests/ui/codegen/duplicated-path-in-error.gnu.stderr new file mode 100644 index 00000000000..d0d34e2f934 --- /dev/null +++ b/tests/ui/codegen/duplicated-path-in-error.gnu.stderr @@ -0,0 +1,2 @@ +error: couldn't load codegen backend /non-existing-one.so: cannot open shared object file: No such file or directory + diff --git a/tests/ui/codegen/duplicated-path-in-error.musl.stderr b/tests/ui/codegen/duplicated-path-in-error.musl.stderr new file mode 100644 index 00000000000..2892ebffdde --- /dev/null +++ b/tests/ui/codegen/duplicated-path-in-error.musl.stderr @@ -0,0 +1,2 @@ +error: couldn't load codegen backend /non-existing-one.so: Error loading shared library /non-existing-one.so: No such file or directory + diff --git a/tests/ui/codegen/duplicated-path-in-error.rs b/tests/ui/codegen/duplicated-path-in-error.rs index a446395de20..fed93828ee2 100644 --- a/tests/ui/codegen/duplicated-path-in-error.rs +++ b/tests/ui/codegen/duplicated-path-in-error.rs @@ -1,8 +1,15 @@ +//@ revisions: musl gnu //@ only-linux +//@ ignore-cross-compile because this relies on host libc behaviour //@ compile-flags: -Zcodegen-backend=/non-existing-one.so +//@[gnu] only-gnu +//@[musl] only-musl // This test ensures that the error of the "not found dylib" doesn't duplicate // the path of the dylib. +// +// glibc and musl have different dlopen error messages, so the expected error +// message differs between the two. fn main() {} diff --git a/tests/ui/codegen/duplicated-path-in-error.stderr b/tests/ui/codegen/duplicated-path-in-error.stderr deleted file mode 100644 index d0d34e2f934..00000000000 --- a/tests/ui/codegen/duplicated-path-in-error.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: couldn't load codegen backend /non-existing-one.so: cannot open shared object file: No such file or directory - -- cgit 1.4.1-3-g733a5