-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ExternalData-support for test data files.
- Loading branch information
1 parent
83beb8b
commit 4e47097
Showing
5 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
build*/ | ||
*.sw[op] | ||
tags | ||
.ExternalData_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
INCLUDE(ExternalData) | ||
|
||
SET(ExternalData_OBJECT_STORES "${ExternalData_OBJECT_STORES_DEFAULT}" CACHE STRING | ||
"Semicolon-separated list of local directories holding test data files in the layout %(algo)/%(hash).") | ||
MARK_AS_ADVANCED(ExternalData_OBJECT_STORES) | ||
IF(NOT ExternalData_OBJECT_STORES) | ||
SET(ExternalData_OBJECT_STORES "${CMAKE_SOURCE_DIR}/../ogs6-data") | ||
FILE(MAKE_DIRECTORY "${ExternalData_OBJECT_STORES}") | ||
ENDIF() | ||
|
||
SET(ExternalData_SOURCE_ROOT ${CMAKE_SOURCE_DIR}/Tests/Data) | ||
SET(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/Tests/Data) | ||
SET(ExternalData_LINK_CONTENT MD5) | ||
|
||
SET(ExternalData_URL_TEMPLATES "http://www.opengeosys.org/images/dev/%(algo)/%(hash)") | ||
|
||
ADD_CUSTOM_TARGET( | ||
move-data | ||
COMMAND ${CMAKE_COMMAND} | ||
-DExternalData_SOURCE_ROOT=${ExternalData_SOURCE_ROOT} | ||
-DExternalData_LINK_CONTENT=${ExternalData_LINK_CONTENT} | ||
-DExternalData_OBJECT_STORES=${ExternalData_OBJECT_STORES} | ||
-P ${PROJECT_SOURCE_DIR}/scripts/cmake/test/MoveDataToStore.cmake | ||
VERBATIM | ||
) | ||
|
||
ExternalData_Add_Test( | ||
data # data target specified above | ||
NAME External-Data-Test | ||
COMMAND ls -ll ${ExternalData_SOURCE_ROOT}/Elliptic/2d-quads-x1000-y1000/ | ||
DATA{${ExternalData_SOURCE_ROOT}/Elliptic/2d-quads-x1000-y1000/,REGEX:.*} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Get all files matching .ExternalData_<algo>_<hash> | ||
FILE(GLOB_RECURSE FILES "" ${ExternalData_SOURCE_ROOT}/.ExternalData_${ExternalData_LINK_CONTENT}_*) | ||
FOREACH(HASH_FILE ${FILES}) | ||
STRING(REGEX MATCH [^_]+$ HASH ${HASH_FILE}) | ||
MESSAGE("Copying ${HASH_FILE} to ${ExternalData_OBJECT_STORES}/${HASH}") | ||
FILE(RENAME ${HASH_FILE} ${ExternalData_OBJECT_STORES}/${ExternalData_LINK_CONTENT}/${HASH}) | ||
ENDFOREACH() |