diff --git a/lib/spack/spack/test/relocate.py b/lib/spack/spack/test/relocate.py index a594f1a9ba..d9becebe7b 100644 --- a/lib/spack/spack/test/relocate.py +++ b/lib/spack/spack/test/relocate.py @@ -253,7 +253,9 @@ def test_replace_prefix_bin(hello_world): # Check that the RPATHs changed patchelf = spack.util.executable.which('patchelf') output = patchelf('--print-rpath', str(executable), output=str) - assert output.strip() == '/foo/lib:/foo/lib64' + + # Some compilers add rpaths so ensure changes included in final result + assert '/foo/lib:/foo/lib64' in output @pytest.mark.requires_executables('patchelf', 'strings', 'file', 'gcc') @@ -280,7 +282,9 @@ def test_relocate_elf_binaries_absolute_paths(hello_world, tmpdir): # Check that the RPATHs changed patchelf = spack.util.executable.which('patchelf') output = patchelf('--print-rpath', str(new_binary), output=str) - assert output.strip() == '/foo/lib:/usr/lib64' + + # Some compilers add rpaths so ensure changes included in final result + assert '/foo/lib:/usr/lib64' in output @pytest.mark.requires_executables('patchelf', 'strings', 'file', 'gcc') @@ -307,4 +311,6 @@ def test_relocate_elf_binaries_relative_paths(hello_world, tmpdir): # Check that the RPATHs changed patchelf = spack.util.executable.which('patchelf') output = patchelf('--print-rpath', str(new_binary), output=str) - assert output.strip() == '/foo/lib:/foo/lib64:/opt/local/lib' + + # Some compilers add rpaths so ensure changes included in final result + assert '/foo/lib:/foo/lib64:/opt/local/lib' in output