Brad King 4befecc77c ExternalData: Add tests covering interfaces and errors
Add a Module.ExternalData test to verify data retrieval and test
argument DATA{} references.

Add a RunCMake.ExternalData test to verify error handling and automatic
transformation of a raw data to a content link and staged object.
2013-01-30 10:04:54 -05:00

20 lines
705 B
CMake

set(input ../Data.txt)
set(output ${CMAKE_BINARY_DIR}/Data.txt)
ExternalData_Expand_Arguments(Data args DATA{${input}})
if("x${args}" STREQUAL "x${output}")
message(STATUS "Data reference correctly transformed in parent dir!")
else()
message(FATAL_ERROR "Data reference transformed to:\n ${args}\n"
"but we expected:\n ${output}")
endif()
set(input Data.txt)
set(output ${CMAKE_CURRENT_BINARY_DIR}/Data.txt)
ExternalData_Expand_Arguments(Data args DATA{${input}})
if("x${args}" STREQUAL "x${output}")
message(STATUS "Data reference correctly transformed in current dir!")
else()
message(FATAL_ERROR "Data reference transformed to:\n ${args}\n"
"but we expected:\n ${output}")
endif()