diff options
Diffstat (limited to 'Tests/Visibility/verify.cmake')
-rw-r--r-- | Tests/Visibility/verify.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/Visibility/verify.cmake b/Tests/Visibility/verify.cmake new file mode 100644 index 0000000..3b2028c --- /dev/null +++ b/Tests/Visibility/verify.cmake @@ -0,0 +1,14 @@ +execute_process(COMMAND ${CMAKE_NM} -D ${TEST_LIBRARY_PATH} + RESULT_VARIABLE RESULT + OUTPUT_VARIABLE OUTPUT + ERROR_VARIABLE ERROR +) + +if(NOT "${RESULT}" STREQUAL "0") + message(FATAL_ERROR "nm failed [${RESULT}] [${OUTPUT}] [${ERROR}]") +endif() + +if(${OUTPUT} MATCHES "(Foo[^\\n]*bar|hidden_function)") + message(FATAL_ERROR + "Found ${CMAKE_MATCH_1} which should have been hidden [${OUTPUT}]") +endif() |