Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
iMSTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Boeckel
iMSTK
Commits
011be7d8
Commit
011be7d8
authored
6 years ago
by
Sreekanth Arikatla
Browse files
Options
Downloads
Patches
Plain Diff
REFAC: remove the resource download test from example cmakelists
parent
1228108a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMake/Utilities/imstkExternalDataDownloadTest.cmake
+29
-0
29 additions, 0 deletions
CMake/Utilities/imstkExternalDataDownloadTest.cmake
CMakeLists.txt
+21
-2
21 additions, 2 deletions
CMakeLists.txt
Examples/CMakeLists.txt
+3
-44
3 additions, 44 deletions
Examples/CMakeLists.txt
with
53 additions
and
46 deletions
CMake/Utilities/imstkExternalDataDownloadTest.cmake
0 → 100644
+
29
−
0
View file @
011be7d8
#-----------------------------------------------------------------------------
# Add ExternalData
#-----------------------------------------------------------------------------
# Remove the data if already here
set
(
hashStampPath
"
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt-hash-stamp"
)
if
(
EXISTS hashStampPath
)
file
(
READ hashStampPath hash
)
string
(
STRIP
"
${
hash
}
"
hash
)
endif
()
execute_process
(
COMMAND rm
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt
COMMAND rm
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt-hash-stamp
COMMAND rm
${
ExternalData_BINARY_ROOT
}
/Objects/SHA512/
${
hash
}
OUTPUT_QUIET
ERROR_QUIET
)
# Download the data
imstk_add_data
(
ExternalDataTest
"Testing/ExternalDataTest.txt"
)
#-----------------------------------------------------------------------------
# Add Test
#-----------------------------------------------------------------------------
# Check if the data has been correctly downloaded
add_test
(
NAME imstkExternalDataTest
COMMAND
${
CMAKE_COMMAND
}
-DFileToCheck=
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt
-P
${
CMAKE_SOURCE_DIR
}
/CMake/Utilities/imstkCheckFileExists.cmake
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
21
−
2
View file @
011be7d8
...
...
@@ -377,11 +377,30 @@ install(
Devel
)
#--------------------------------------------------------------------------
# Test data download
#--------------------------------------------------------------------------
include
(
imstkExternalDataDownloadTest
)
#--------------------------------------------------------------------------
# Append external data needed for testing to be downloaded later
#--------------------------------------------------------------------------
list
(
APPEND FILE_LIST
asianDragon/,REGEX:.*
human/,REGEX:.*
oneTet/,REGEX:.*
)
#--------------------------------------------------------------------------
# Add Examples subdirectories
#--------------------------------------------------------------------------
add_subdirectory
(
Examples
)
if
(
BUILD_EXAMPLES
)
add_subdirectory
(
Examples
)
endif
()
#-----------------------------------------------------------------------------
# Download the external data needed for both testing and examples
#-----------------------------------------------------------------------------
imstk_add_data
(
${
PROJECT_NAME
}
${
FILE_LIST
}
)
#--------------------------------------------------------------------------
# Innerbuild dummy test
...
...
@@ -389,4 +408,4 @@ add_subdirectory(Examples)
add_test
(
NAME imstkDummyTest
COMMAND
${
CMAKE_COMMAND
}
-E echo
"Success"
)
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Examples/CMakeLists.txt
+
3
−
44
View file @
011be7d8
#-----------------------------------------------------------------------------
# Add ExternalData
#-----------------------------------------------------------------------------
# Remove the data if already here
set
(
hashStampPath
"
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt-hash-stamp"
)
if
(
EXISTS hashStampPath
)
file
(
READ hashStampPath hash
)
string
(
STRIP
"
${
hash
}
"
hash
)
endif
()
execute_process
(
COMMAND rm
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt
COMMAND rm
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt-hash-stamp
COMMAND rm
${
ExternalData_BINARY_ROOT
}
/Objects/SHA512/
${
hash
}
OUTPUT_QUIET
ERROR_QUIET
)
# Download the data
imstk_add_data
(
ExternalDataTest
"Testing/ExternalDataTest.txt"
)
#-----------------------------------------------------------------------------
# Add Test
#-----------------------------------------------------------------------------
# Check if the data has been correctly downloaded
add_test
(
NAME imstkExternalDataTest
COMMAND
${
CMAKE_COMMAND
}
-DFileToCheck=
${
ExternalData_BINARY_ROOT
}
/Data/Testing/ExternalDataTest.txt
-P
${
CMAKE_SOURCE_DIR
}
/CMake/Utilities/imstkCheckFileExists.cmake
)
# Associate external data needed for testing
list
(
APPEND FILE_LIST
asianDragon/,REGEX:.*,
human/,REGEX:.*,
oneTet/,REGEX:.*
)
#-----------------------------------------------------------------------------
# Add Example subdirectories
#-----------------------------------------------------------------------------
if
(
BUILD_EXAMPLES
)
macro
(
listOfSubDir result curdir
)
macro
(
listOfSubDir result curdir
)
file
(
GLOB children RELATIVE
${
curdir
}
${
curdir
}
/*
)
set
(
dirlist
""
)
foreach
(
child
${
children
}
)
...
...
@@ -53,10 +16,6 @@ if(BUILD_EXAMPLES)
foreach
(
subdir
${
subDirs
}
)
add_subdirectory
(
${
subdir
}
)
endforeach
()
endif
()
endforeach
()
#-----------------------------------------------------------------------------
# Add external data
#-----------------------------------------------------------------------------
imstk_add_data
(
${
PROJECT_NAME
}
${
FILE_LIST
}
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment