From a8a47098082a57a5b22cac546f030b551e1b9c32 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 20:35:13 +0100 Subject: Tests: CPack/DEB test change prerequirements check Prerequirements should be searched for in generator prerequirements function and only checked for presence in configure file in per test prerequirements function. --- Tests/RunCMake/CPack/DEB/Helpers.cmake | 2 -- Tests/RunCMake/CPack/DEB/Prerequirements.cmake | 7 +++++++ .../RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake | 4 ++-- .../CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake index 349b987..ad1b47b 100644 --- a/Tests/RunCMake/CPack/DEB/Helpers.cmake +++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake @@ -84,8 +84,6 @@ function(getMissingShlibsErrorExtra FILE RESULT_VAR) string(APPEND error_extra "; errors \"${deb_install_files_errors}\"") endif() - find_program(READELF_EXECUTABLE NAMES readelf) - if(READELF_EXECUTABLE) string(APPEND error_extra "; readelf \"\n") diff --git a/Tests/RunCMake/CPack/DEB/Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake index cb9a277..60d02e7 100644 --- a/Tests/RunCMake/CPack/DEB/Prerequirements.cmake +++ b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake @@ -12,4 +12,11 @@ function(get_test_prerequirements found_var config_file) file(APPEND "${config_file}" "\nset(FAKEROOT_EXECUTABLE \"${FAKEROOT_EXECUTABLE}\")") endif() + + # optional tool for some tests + find_program(READELF_EXECUTABLE NAMES readelf) + if(READELF_EXECUTABLE) + file(APPEND "${config_file}" + "\nset(READELF_EXECUTABLE \"${READELF_EXECUTABLE}\")") + endif() endfunction() diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake index b98065a..be44b2e 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake @@ -1,5 +1,5 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) +function(get_test_prerequirements found_var config_file) + include(${config_file}) if(READELF_EXECUTABLE) set(${found_var} true PARENT_SCOPE) diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake index b98065a..be44b2e 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake @@ -1,5 +1,5 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) +function(get_test_prerequirements found_var config_file) + include(${config_file}) if(READELF_EXECUTABLE) set(${found_var} true PARENT_SCOPE) -- cgit v0.12