From 92989fbbfdc68c25df64004c6b0802431cc4055d Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Wed, 20 May 2020 09:11:26 -0700 Subject: [PATCH] tests: check presence not equality for rpath changes (#16637) Fixes #16636 --- lib/spack/spack/test/relocate.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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