[cmake-developers] [PATCH] Tests: Use a less strict regular expression to look for "SONAME".

Brad King brad.king at kitware.com
Tue Sep 1 09:39:07 EDT 2015


On 09/01/2015 09:30 AM, Raphael Kubo da Costa wrote:
> That's because that script is asserting that the regular expression does
> _not_ match, which is always the case when GNU binutils is not used.

Prior to the refactoring it also tested for existence.  See below.
How did that pass before?

Thanks,
-Brad


$ git show v3.3.1:Tests/Plugin/check_mod_soname.cmake
execute_process(COMMAND ${readelf} -d ${mod1} OUTPUT_FILE ${mod1}.readelf.txt)
execute_process(COMMAND ${readelf} -d ${mod2} OUTPUT_FILE ${mod2}.readelf.txt)
file(STRINGS ${mod1}.readelf.txt soname1 REGEX "\\(SONAME\\)")
file(STRINGS ${mod2}.readelf.txt soname2 REGEX "\\(SONAME\\)")
if(soname1)
  message(STATUS "${mod1} has soname as expected: ${soname1}")
else()
  message(FATAL_ERROR "${mod1} has no soname but should:\n  ${soname1}")
endif()
if(soname2)
  message(FATAL_ERROR "${mod2} has soname but should not:\n  ${soname2}")
else()
  message(STATUS "${mod2} has no soname as expected")
endif()



More information about the cmake-developers mailing list