ExternalData: Test content link with a space in its name

Extend the Module.ExternalData test to cover a DATA{} reference whose
name contains a space.  Skip the case when the native build tool does
not support spaces.
This commit is contained in:
Brad King 2013-02-21 09:59:29 -05:00
parent d45eb35350
commit 55f0148d7b
4 changed files with 13 additions and 0 deletions

View File

@ -347,6 +347,7 @@ if(BUILD_TESTING)
--build-project ExternalDataTest --build-project ExternalDataTest
--build-noclean --build-noclean
--force-new-ctest-process --force-new-ctest-process
--build-options -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V
) )
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData")

View File

@ -14,10 +14,15 @@ set(ExternalData_URL_TEMPLATES
set(ExternalData_BINARY_ROOT "${CMAKE_CURRENT_BINARY_DIR}/ExternalData") set(ExternalData_BINARY_ROOT "${CMAKE_CURRENT_BINARY_DIR}/ExternalData")
file(REMOVE_RECURSE ${ExternalData_BINARY_ROOT}) # clean test file(REMOVE_RECURSE ${ExternalData_BINARY_ROOT}) # clean test
if(MAKE_SUPPORTS_SPACES)
set(Data1CheckSpaces -D "DataSpace=DATA{Data Space.dat}")
endif()
ExternalData_Add_Test(Data1 ExternalData_Add_Test(Data1
NAME Data1Check NAME Data1Check
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-D Data=DATA{Data.dat} -D Data=DATA{Data.dat}
${Data1CheckSpaces}
-D SeriesA=DATA{SeriesA.dat,:} -D SeriesA=DATA{SeriesA.dat,:}
-D SeriesB=DATA{SeriesB.dat,:} -D SeriesB=DATA{SeriesB.dat,:}
-D SeriesC=DATA{SeriesC.dat,:} -D SeriesC=DATA{SeriesC.dat,:}

View File

@ -0,0 +1 @@
8c018830e3efa5caf3c7415028335a57

View File

@ -2,6 +2,12 @@ file(STRINGS "${Data}" lines LIMIT_INPUT 1024)
if(NOT "x${lines}" STREQUAL "xInput file already transformed.") if(NOT "x${lines}" STREQUAL "xInput file already transformed.")
message(SEND_ERROR "Input file:\n ${Data}\ndoes not have expected content, but [[${lines}]]") message(SEND_ERROR "Input file:\n ${Data}\ndoes not have expected content, but [[${lines}]]")
endif() endif()
if(DEFINED DataSpace)
file(STRINGS "${DataSpace}" lines LIMIT_INPUT 1024)
if(NOT "x${lines}" STREQUAL "xInput file already transformed.")
message(SEND_ERROR "Input file:\n ${DataSpace}\ndoes not have expected content, but [[${lines}]]")
endif()
endif()
set(SeriesAn1 "1\\.dat") set(SeriesAn1 "1\\.dat")
set(SeriesBn1 "_1\\.dat") set(SeriesBn1 "_1\\.dat")
set(SeriesCn1 "\\.1\\.dat") set(SeriesCn1 "\\.1\\.dat")