From 1a2a9b0d08c7ba2af168856b1220d42ff9a80921 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 26 Jan 2017 10:09:55 -0500 Subject: Tests: Simplify GeneratorExpression imported include directory check Do not duplicate the list of include directories 4 times. --- Tests/GeneratorExpression/CMakeLists.txt | 5 +---- Tests/GeneratorExpression/check-part3.cmake | 19 ++++++++----------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index f0d6abf..8ecfdd9 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -187,10 +187,7 @@ add_custom_target(check-part3 ALL -Dtest_version_equal_1=$ -Dtest_version_equal_2=$ -Dconfig=$ - -Dtest_imported_debug=$ - -Dtest_imported_release=$ - -Dtest_imported_relwithdebinfo=$ - -Dtest_imported_minsizerel=$ + -Dtest_imported_includes=$ -Dtest_imported_fallback=$,fallback_loc> -Dtest_alias_file_exe=$,$> -Dtest_alias_file_lib=$,$> diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index e12d8c6..927ead4 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -8,18 +8,15 @@ check(test_version_less_2 "1") check(test_version_equal_1 "0") check(test_version_equal_2 "1") -foreach(c debug release relwithdebinfo minsizerel) - if(config AND NOT config STREQUAL NoConfig) - if(NOT "${test_imported_${c}}" MATCHES "^;/imported2/include$" - AND NOT "${test_imported_${c}}" MATCHES "^/imported1/include;$") - message(SEND_ERROR "test_imported_${c} is not correct: ${test_imported_${c}}") - endif() - else() - if(NOT "${test_imported_${c}}" MATCHES "^;$") - message(SEND_ERROR "test_imported_${c} is not an empty list: ${test_imported_${c}}") - endif() +if(config AND NOT config STREQUAL NoConfig) + if(NOT "${test_imported_includes}" MATCHES "^;*/imported[12]/include;*$") + message(SEND_ERROR "test_imported_includes is not correct: ${test_imported_includes}") endif() -endforeach() +else() + if(NOT "${test_imported_includes}" MATCHES "^;$") + message(SEND_ERROR "test_imported_includes is not an empty list: ${test_imported_includes}") + endif() +endif() check(test_imported_fallback "1") -- cgit v0.12