summaryrefslogtreecommitdiffstats
path: root/Tests/Plugin/check_mod_soname.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-04-23 13:53:29 (GMT)
committerBrad King <brad.king@kitware.com>2012-04-30 15:53:27 (GMT)
commitfdb3f878fec158ab284130a55849ada9edbd6fd1 (patch)
treec16db86a29fa9fc3e40f2303c64c9f0481d356f5 /Tests/Plugin/check_mod_soname.cmake
parente1409ac59bce76258c054a8ddcaed75425e072b8 (diff)
downloadCMake-fdb3f878fec158ab284130a55849ada9edbd6fd1.zip
CMake-fdb3f878fec158ab284130a55849ada9edbd6fd1.tar.gz
CMake-fdb3f878fec158ab284130a55849ada9edbd6fd1.tar.bz2
Test NO_SONAME property (#13155)
Teach the Plugin test to check that the NO_SONAME target property works as documented. Check that the IMPORTED targets are written with the correct properties. When readelf is available use it to check the actual binary files for SONAME fields.
Diffstat (limited to 'Tests/Plugin/check_mod_soname.cmake')
-rw-r--r--Tests/Plugin/check_mod_soname.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/Plugin/check_mod_soname.cmake b/Tests/Plugin/check_mod_soname.cmake
new file mode 100644
index 0000000..3737b45
--- /dev/null
+++ b/Tests/Plugin/check_mod_soname.cmake
@@ -0,0 +1,14 @@
+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()