summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VSSolution/solution_parsing.cmake
diff options
context:
space:
mode:
authorTaylor Braun-Jones <taylor@braun-jones.org>2016-03-21 18:34:34 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-22 16:41:30 (GMT)
commitc05ea48545f04dee8666094b0731366b64dfc9ad (patch)
tree88c0b7a47d4de7c5ac5ce4262f31ba61e09a9958 /Tests/RunCMake/VSSolution/solution_parsing.cmake
parent78ec04613063653008f221eed644f1c2566fd900 (diff)
downloadCMake-c05ea48545f04dee8666094b0731366b64dfc9ad.zip
CMake-c05ea48545f04dee8666094b0731366b64dfc9ad.tar.gz
CMake-c05ea48545f04dee8666094b0731366b64dfc9ad.tar.bz2
VS: Improve unit test macros
Change `getFirstProject` macro to more flexible version `getProjectNames`
Diffstat (limited to 'Tests/RunCMake/VSSolution/solution_parsing.cmake')
-rw-r--r--Tests/RunCMake/VSSolution/solution_parsing.cmake15
1 files changed, 8 insertions, 7 deletions
diff --git a/Tests/RunCMake/VSSolution/solution_parsing.cmake b/Tests/RunCMake/VSSolution/solution_parsing.cmake
index 001b584..4e5bb59 100644
--- a/Tests/RunCMake/VSSolution/solution_parsing.cmake
+++ b/Tests/RunCMake/VSSolution/solution_parsing.cmake
@@ -50,17 +50,18 @@ macro(parseGlobalSections arg_out_pre arg_out_post testName)
endmacro()
-macro(getFirstProject arg_out_first_project testName)
- set(${arg_out_first_project} "")
- set(sln "${RunCMake_TEST_BINARY_DIR}/${testName}.sln")
+macro(getProjectNames arg_out_projects)
+ set(${arg_out_projects} "")
+ set(sln "${RunCMake_TEST_BINARY_DIR}/${test}.sln")
if(NOT EXISTS "${sln}")
error("Expected solution file ${sln} does not exist")
endif()
file(STRINGS "${sln}" project_lines REGEX "^Project\\(")
- list(GET project_lines 0 first_project)
- string(REGEX REPLACE ".* = \"" "" first_project "${first_project}")
- string(REGEX REPLACE "\", .*" "" first_project "${first_project}")
- set(${arg_out_first_project} "${first_project}")
+ foreach(project_line IN LISTS project_lines)
+ string(REGEX REPLACE ".* = \"" "" project_line "${project_line}")
+ string(REGEX REPLACE "\", .*" "" project_line "${project_line}")
+ list(APPEND ${arg_out_projects} "${project_line}")
+ endforeach()
endmacro()