diff options
author | Brad King <brad.king@kitware.com> | 2016-03-18 17:20:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-03-18 17:20:42 (GMT) |
commit | 5c1f4da83d1142e52b361e8f59dd68ea5728e843 (patch) | |
tree | bf0266562e08dcb357ad2b46cb5e34089c45812a /Tests/RunCMake/SolutionGlobalSections | |
parent | 9cdb37e9175b2e3c6367bc4863fda0404cb1c3a2 (diff) | |
download | CMake-5c1f4da83d1142e52b361e8f59dd68ea5728e843.zip CMake-5c1f4da83d1142e52b361e8f59dd68ea5728e843.tar.gz CMake-5c1f4da83d1142e52b361e8f59dd68ea5728e843.tar.bz2 |
Tests: Rename RunCMake.{SolutionGlobalSections => VSSolution}
The test will be suitable for covering other `.sln` content too.
Diffstat (limited to 'Tests/RunCMake/SolutionGlobalSections')
17 files changed, 0 insertions, 119 deletions
diff --git a/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt b/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt deleted file mode 100644 index 12cd3c7..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -cmake_minimum_required(VERSION 2.8.4) -project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePost-check.cmake b/Tests/RunCMake/SolutionGlobalSections/MorePost-check.cmake deleted file mode 100644 index 0f7e370..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/MorePost-check.cmake +++ /dev/null @@ -1,5 +0,0 @@ -parseGlobalSections(pre post MorePost) -testGlobalSection(post TestSec2 Key1=Value1 "Key2=Value with spaces") -testGlobalSection(post TestSec4 Key6=Value1 "Key7=Value with spaces" Key8=ValueWithoutSpaces) -testGlobalSection(post ExtensibilityGlobals) -testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePost.cmake b/Tests/RunCMake/SolutionGlobalSections/MorePost.cmake deleted file mode 100644 index 2eb3f60..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/MorePost.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_TestSec2 Key1=Value1 "Key2=Value with spaces") -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_TestSec4 Key6=Value1 "Key7=Value with spaces" "Key8 =ValueWithoutSpaces") diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePre-check.cmake b/Tests/RunCMake/SolutionGlobalSections/MorePre-check.cmake deleted file mode 100644 index 45e7419..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/MorePre-check.cmake +++ /dev/null @@ -1,5 +0,0 @@ -parseGlobalSections(pre post MorePre) -testGlobalSection(pre TestSec1 Key1=Value1 "Key2=Value with spaces") -testGlobalSection(pre TestSec3 Key3=Value1 "Key4=Value with spaces" Key5=ValueWithoutSpaces) -testGlobalSection(post ExtensibilityGlobals) -testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePre.cmake b/Tests/RunCMake/SolutionGlobalSections/MorePre.cmake deleted file mode 100644 index 07f4eb8..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/MorePre.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_PRE_TestSec1 Key1=Value1 "Key2=Value with spaces") -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_PRE_TestSec3 Key3=Value1 "Key4=Value with spaces" "Key5 = ValueWithoutSpaces") diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePost-check.cmake b/Tests/RunCMake/SolutionGlobalSections/OnePost-check.cmake deleted file mode 100644 index 6af5156..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/OnePost-check.cmake +++ /dev/null @@ -1,4 +0,0 @@ -parseGlobalSections(pre post OnePost) -testGlobalSection(post TestSec2 Key1=Value1 "Key2=Value with spaces") -testGlobalSection(post ExtensibilityGlobals) -testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePost.cmake b/Tests/RunCMake/SolutionGlobalSections/OnePost.cmake deleted file mode 100644 index 2295cfb..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/OnePost.cmake +++ /dev/null @@ -1 +0,0 @@ -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_TestSec2 Key1=Value1 "Key2=Value with spaces") diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePre-check.cmake b/Tests/RunCMake/SolutionGlobalSections/OnePre-check.cmake deleted file mode 100644 index 70b18b2..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/OnePre-check.cmake +++ /dev/null @@ -1,4 +0,0 @@ -parseGlobalSections(pre post OnePre) -testGlobalSection(pre TestSec1 Key1=Value1 "Key2=Value with spaces") -testGlobalSection(post ExtensibilityGlobals) -testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePre.cmake b/Tests/RunCMake/SolutionGlobalSections/OnePre.cmake deleted file mode 100644 index 1499b47..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/OnePre.cmake +++ /dev/null @@ -1 +0,0 @@ -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_PRE_TestSec1 Key1=Value1 "Key2=Value with spaces") diff --git a/Tests/RunCMake/SolutionGlobalSections/Override1-check.cmake b/Tests/RunCMake/SolutionGlobalSections/Override1-check.cmake deleted file mode 100644 index a19e2e1..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/Override1-check.cmake +++ /dev/null @@ -1,4 +0,0 @@ -parseGlobalSections(pre post Override1) -testGlobalSection(post TestSec Key2=Value2 Key3=Value3) -testGlobalSection(post ExtensibilityGlobals Key1=Value1) -testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/SolutionGlobalSections/Override1.cmake b/Tests/RunCMake/SolutionGlobalSections/Override1.cmake deleted file mode 100644 index a726c9f..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/Override1.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_ExtensibilityGlobals Key1=Value1) -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_TestSec Key2=Value2 Key3=Value3) diff --git a/Tests/RunCMake/SolutionGlobalSections/Override2-check.cmake b/Tests/RunCMake/SolutionGlobalSections/Override2-check.cmake deleted file mode 100644 index d9656e1..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/Override2-check.cmake +++ /dev/null @@ -1,4 +0,0 @@ -parseGlobalSections(pre post Override2) -testGlobalSection(pre TestSec Key2=Value2 Key3=Value3) -testGlobalSection(post ExtensibilityGlobals) -testGlobalSection(post ExtensibilityAddIns Key1=Value1) diff --git a/Tests/RunCMake/SolutionGlobalSections/Override2.cmake b/Tests/RunCMake/SolutionGlobalSections/Override2.cmake deleted file mode 100644 index 0ce43cc..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/Override2.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_ExtensibilityAddIns Key1=Value1) -set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_PRE_TestSec Key2=Value2 Key3=Value3) diff --git a/Tests/RunCMake/SolutionGlobalSections/PrePost-check.cmake b/Tests/RunCMake/SolutionGlobalSections/PrePost-check.cmake deleted file mode 100644 index 322a689..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/PrePost-check.cmake +++ /dev/null @@ -1,6 +0,0 @@ -parseGlobalSections(pre post PrePost) -testGlobalSection(post Postsec Key1=Value2) -testGlobalSection(pre Presec Key1=Value1 "Key2=Value with some spaces") -testGlobalSection(post Emptysec) -testGlobalSection(post ExtensibilityGlobals) -testGlobalSection(post ExtensibilityAddIns) diff --git a/Tests/RunCMake/SolutionGlobalSections/PrePost.cmake b/Tests/RunCMake/SolutionGlobalSections/PrePost.cmake deleted file mode 100644 index 976c341..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/PrePost.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set_directory_properties(PROPERTIES - VS_GLOBAL_SECTION_POST_Postsec Key1=Value2 - VS_GLOBAL_SECTION_PRE_Presec "Key1=Value1;Key2= Value with some spaces" - VS_GLOBAL_SECTION_POST_Emptysec "") diff --git a/Tests/RunCMake/SolutionGlobalSections/RunCMakeTest.cmake b/Tests/RunCMake/SolutionGlobalSections/RunCMakeTest.cmake deleted file mode 100644 index 6ae158d..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/RunCMakeTest.cmake +++ /dev/null @@ -1,10 +0,0 @@ -include(RunCMake) -include(${CMAKE_CURRENT_LIST_DIR}/solution_parsing.cmake) - -run_cmake(OnePre) -run_cmake(OnePost) -run_cmake(MorePre) -run_cmake(MorePost) -run_cmake(PrePost) -run_cmake(Override1) -run_cmake(Override2) diff --git a/Tests/RunCMake/SolutionGlobalSections/solution_parsing.cmake b/Tests/RunCMake/SolutionGlobalSections/solution_parsing.cmake deleted file mode 100644 index dd158ef..0000000 --- a/Tests/RunCMake/SolutionGlobalSections/solution_parsing.cmake +++ /dev/null @@ -1,60 +0,0 @@ -macro(error text) - set(RunCMake_TEST_FAILED "${text}") - return() -endmacro() - - -macro(parseGlobalSections arg_out_pre arg_out_post testName) - set(out_pre ${arg_out_pre}) - set(out_post ${arg_out_post}) - set(sln "${RunCMake_TEST_BINARY_DIR}/${testName}.sln") - if(NOT EXISTS "${sln}") - error("Expected solution file ${sln} does not exist") - endif() - file(STRINGS "${sln}" lines) - set(sectionLines "") - set(store FALSE) - foreach(line IN LISTS lines) - if(line MATCHES "^\t*Global\n?$") - set(store TRUE) - elseif(line MATCHES "^\t*EndGlobal\n?$") - set(store FALSE) - elseif(store) - list(APPEND sectionLines "${line}") - endif() - endforeach() - set(sectionName "") - set(sectionType "") - foreach(line IN LISTS sectionLines) - if(line MATCHES "^\t*GlobalSection\\((.*)\\) *= *(pre|post)Solution\n?$") - set(sectionName "${CMAKE_MATCH_1}") - set(sectionType ${CMAKE_MATCH_2}) - list(APPEND ${out_${sectionType}} "${sectionName}") - if(DEFINED ${out_${sectionType}}_${sectionName}) - error("Section ${sectionName} defined twice") - endif() - set(${out_${sectionType}}_${sectionName} "") - elseif(line MATCHES "\t*EndGlobalSection\n?$") - set(sectionName "") - set(sectionType "") - elseif(sectionName) - string(REGEX MATCH "^\t*([^=]*)=([^\n]*)\n?$" matches "${line}") - if(NOT matches) - error("Bad syntax in solution file: '${line}'") - endif() - string(STRIP "${CMAKE_MATCH_1}" key) - string(STRIP "${CMAKE_MATCH_2}" value) - list(APPEND ${out_${sectionType}}_${sectionName} "${key}=${value}") - endif() - endforeach() -endmacro() - - -macro(testGlobalSection prefix sectionName) - if(NOT DEFINED ${prefix}_${sectionName}) - error("Section ${sectionName} does not exist") - endif() - if(NOT "${${prefix}_${sectionName}}" STREQUAL "${ARGN}") - error("Section ${sectionName} content mismatch\n expected: ${ARGN}\n actual: ${${prefix}_${sectionName}}") - endif() -endmacro() |