diff options
author | Brad King <brad.king@kitware.com> | 2013-01-25 21:39:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-01-30 15:04:54 (GMT) |
commit | 4befecc77caa97aeb450d9a2b6bcbe0985dc4054 (patch) | |
tree | 466fb00e26d9db362d64b530bc7bda952106e3d8 /Tests/Module/ExternalData/Data3 | |
parent | bcd25808ac540d279a36a9e0f1b60f152fc0d6bb (diff) | |
download | CMake-4befecc77caa97aeb450d9a2b6bcbe0985dc4054.zip CMake-4befecc77caa97aeb450d9a2b6bcbe0985dc4054.tar.gz CMake-4befecc77caa97aeb450d9a2b6bcbe0985dc4054.tar.bz2 |
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.
Diffstat (limited to 'Tests/Module/ExternalData/Data3')
-rw-r--r-- | Tests/Module/ExternalData/Data3/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/Module/ExternalData/Data3/Data.dat.md5 | 1 | ||||
-rw-r--r-- | Tests/Module/ExternalData/Data3/Data3Check.cmake | 25 | ||||
-rw-r--r-- | Tests/Module/ExternalData/Data3/Other.dat.md5 | 1 |
4 files changed, 41 insertions, 0 deletions
diff --git a/Tests/Module/ExternalData/Data3/CMakeLists.txt b/Tests/Module/ExternalData/Data3/CMakeLists.txt new file mode 100644 index 0000000..a7c2b6e --- /dev/null +++ b/Tests/Module/ExternalData/Data3/CMakeLists.txt @@ -0,0 +1,14 @@ +set(Store0 ${CMAKE_BINARY_DIR}/ExternalData/Other) +set(Store1 ${CMAKE_BINARY_DIR}/ExternalData/Objects) +set(ExternalData_OBJECT_STORES ${Store0} ${Store1}) +ExternalData_Add_Test(Data3 + NAME Data3Check + COMMAND ${CMAKE_COMMAND} + -D Data=DATA{Data.dat} + -D Other=DATA{Other.dat} + -D Store0=${Store0} + -D Store1=${Store1} + -P ${CMAKE_CURRENT_SOURCE_DIR}/Data3Check.cmake + ) +ExternalData_Add_Target(Data3) +add_dependencies(Data3 Data1 Data2) diff --git a/Tests/Module/ExternalData/Data3/Data.dat.md5 b/Tests/Module/ExternalData/Data3/Data.dat.md5 new file mode 100644 index 0000000..70e39bd --- /dev/null +++ b/Tests/Module/ExternalData/Data3/Data.dat.md5 @@ -0,0 +1 @@ +8c018830e3efa5caf3c7415028335a57 diff --git a/Tests/Module/ExternalData/Data3/Data3Check.cmake b/Tests/Module/ExternalData/Data3/Data3Check.cmake new file mode 100644 index 0000000..de98839 --- /dev/null +++ b/Tests/Module/ExternalData/Data3/Data3Check.cmake @@ -0,0 +1,25 @@ +if(NOT EXISTS "${Data}") + message(SEND_ERROR "Input file:\n ${Data}\ndoes not exist!") +endif() +if(NOT EXISTS "${Other}") + message(SEND_ERROR "Input file:\n ${Other}\ndoes not exist!") +endif() +# Verify that the 'Data' object was found in the second store location left +# from Data1 target downloads and that the 'Other' object was downloaded to +# our first store location. Neither object should exist in the other store. +foreach(should_exist + "${Store0}/MD5/aaad162b85f60d1eb57ca71a23e8efd7" + "${Store1}/MD5/8c018830e3efa5caf3c7415028335a57" + ) + if(NOT EXISTS ${should_exist}) + message(SEND_ERROR "Store file:\n ${should_exist}\nshould exist!") + endif() +endforeach() +foreach(should_not_exist + "${Store0}/MD5/8c018830e3efa5caf3c7415028335a57" + "${Store1}/MD5/aaad162b85f60d1eb57ca71a23e8efd7" + ) + if(EXISTS ${should_not_exist}) + message(SEND_ERROR "Store file:\n ${should_not_exist}\nshould not exist!") + endif() +endforeach() diff --git a/Tests/Module/ExternalData/Data3/Other.dat.md5 b/Tests/Module/ExternalData/Data3/Other.dat.md5 new file mode 100644 index 0000000..5312faa --- /dev/null +++ b/Tests/Module/ExternalData/Data3/Other.dat.md5 @@ -0,0 +1 @@ +aaad162b85f60d1eb57ca71a23e8efd7 |