Commit 899458ab ("Tests: Cover NO_SONAME property for SHARED libraries") introduced a few new ExportImport tests, and the check_lib_{no}soname.cmake scripts that parse readelf(1)'s output.
Make the regular expression matching the SONAME line output by readelf less strict, as the output format varies across implementations: GNU binutils' readelf is the only one to write each ELF header within parentheses (which the previous regular expression expected). The new tests were thus failing when either Fedora's elfutils (eu-readelf) or elftoolchain's readelf (present on recent FreeBSD versions) were being used, as they both list the headers without parentheses. The same issue also affected Tests/Plugin's check_mod_soname.cmake, so fix that one as well -- the only reason the test was not failing is that it tested that the regular expression did not match, which was always the case with a non-binutils readelf. --- Tests/ExportImport/Import/A/check_lib_nosoname.cmake | 2 +- Tests/ExportImport/Import/A/check_lib_soname.cmake | 2 +- Tests/Plugin/check_mod_soname.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/ExportImport/Import/A/check_lib_nosoname.cmake b/Tests/ExportImport/Import/A/check_lib_nosoname.cmake index 6261ff4..613391e 100644 --- a/Tests/ExportImport/Import/A/check_lib_nosoname.cmake +++ b/Tests/ExportImport/Import/A/check_lib_nosoname.cmake @@ -1,5 +1,5 @@ execute_process(COMMAND ${readelf} -d ${lib} OUTPUT_FILE ${lib}.readelf.txt) -file(STRINGS ${lib}.readelf.txt soname REGEX "\\(SONAME\\)") +file(STRINGS ${lib}.readelf.txt soname REGEX "SONAME") if(soname) message(FATAL_ERROR "${lib} has soname but should not:\n ${soname}") else() diff --git a/Tests/ExportImport/Import/A/check_lib_soname.cmake b/Tests/ExportImport/Import/A/check_lib_soname.cmake index 7794e80..a3c4b54 100644 --- a/Tests/ExportImport/Import/A/check_lib_soname.cmake +++ b/Tests/ExportImport/Import/A/check_lib_soname.cmake @@ -1,5 +1,5 @@ execute_process(COMMAND ${readelf} -d ${lib} OUTPUT_FILE ${lib}.readelf.txt) -file(STRINGS ${lib}.readelf.txt soname REGEX "\\(SONAME\\)") +file(STRINGS ${lib}.readelf.txt soname REGEX "SONAME") if(soname) message(STATUS "${lib} has soname as expected:\n ${soname}") else() diff --git a/Tests/Plugin/check_mod_soname.cmake b/Tests/Plugin/check_mod_soname.cmake index 21a33b1..eeededa 100644 --- a/Tests/Plugin/check_mod_soname.cmake +++ b/Tests/Plugin/check_mod_soname.cmake @@ -1,5 +1,5 @@ execute_process(COMMAND ${readelf} -d ${mod} OUTPUT_FILE ${mod}.readelf.txt) -file(STRINGS ${mod}.readelf.txt soname REGEX "\\(SONAME\\)") +file(STRINGS ${mod}.readelf.txt soname REGEX "SONAME") if(soname) message(FATAL_ERROR "${mod} has soname but should not:\n ${soname}") else() -- 2.4.6 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers