Skip to content
Snippets Groups Projects
Commit e7eacc0a authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

Merge branch 'downloadUnitTestData' into 'master'

Download unit test data separately

See merge request iMSTK/iMSTK!252
parents 53fca9a6 0f65350a
No related branches found
No related tags found
No related merge requests found
Showing
with 193 additions and 59 deletions
#-----------------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------------
# Compile Shaders
#-----------------------------------------------------------------------------
function(compileShaders sourceShader binaryShader)
add_custom_command(
TARGET ${PROJECT_NAME}
COMMAND glslangvalidator -V ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders/${sourceShader} -o ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders/${binaryShader})
endfunction()
function(CopyAndCompileShaders)
if( iMSTK_USE_Vulkan )
file(COPY ${CMAKE_SOURCE_DIR}/Source/Rendering/VulkanRenderer/VulkanShaders
DESTINATION ${PROJECT_BINARY_DIR}/Shaders)
# Mesh shaders
compileShaders(Mesh/mesh_vert.vert Mesh/mesh_vert.spv)
compileShaders(Mesh/mesh_tesc.tesc Mesh/mesh_tesc.spv)
compileShaders(Mesh/mesh_tese.tese Mesh/mesh_tese.spv)
compileShaders(Mesh/mesh_frag.frag Mesh/mesh_frag.spv)
compileShaders(Mesh/decal_vert.vert Mesh/decal_vert.spv)
compileShaders(Mesh/decal_frag.frag Mesh/decal_frag.spv)
compileShaders(Mesh/shadow_vert.vert Mesh/shadow_vert.spv)
compileShaders(Mesh/shadow_frag.frag Mesh/shadow_frag.spv)
compileShaders(Mesh/depth_frag.frag Mesh/depth_frag.spv)
# Post processing shaders
compileShaders(PostProcessing/HDR_tonemap_frag.frag PostProcessing/HDR_tonemap_frag.spv)
compileShaders(PostProcessing/postprocess_vert.vert PostProcessing/postprocess_vert.spv)
compileShaders(PostProcessing/postprocess_frag.frag PostProcessing/postprocess_frag.spv)
compileShaders(PostProcessing/sss_frag.frag PostProcessing/sss_frag.spv)
compileShaders(PostProcessing/composite_frag.frag PostProcessing/composite_frag.spv)
compileShaders(PostProcessing/bloom_threshold_frag.frag PostProcessing/bloom_threshold_frag.spv)
compileShaders(PostProcessing/blur_horizontal_frag.frag PostProcessing/blur_horizontal_frag.spv)
compileShaders(PostProcessing/blur_vertical_frag.frag PostProcessing/blur_vertical_frag.spv)
compileShaders(PostProcessing/bloom_threshold_frag.frag PostProcessing/bloom_threshold_frag.spv)
compileShaders(PostProcessing/ao_frag.frag PostProcessing/ao_frag.spv)
compileShaders(PostProcessing/bilateral_blur_horizontal_frag.frag PostProcessing/bilateral_blur_horizontal_frag.spv)
compileShaders(PostProcessing/bilateral_blur_vertical_frag.frag PostProcessing/bilateral_blur_vertical_frag.spv)
compileShaders(PostProcessing/depth_downscale_frag.frag PostProcessing/depth_downscale_frag.spv)
file(COPY ${PROJECT_BINARY_DIR}/Shaders/VulkanShaders
DESTINATION ${CMAKE_PROGRAM_PATH}/Shaders)
else( iMSTK_USE_Vulkan )
file(COPY ${CMAKE_SOURCE_DIR}/Source/Rendering/VTKRenderer/VTKShaders
DESTINATION ${PROJECT_BINARY_DIR}/Shaders)
file(COPY ${CMAKE_SOURCE_DIR}/Source/Rendering/VTKRenderer/VTKShaders
DESTINATION ${CMAKE_PROGRAM_PATH}/Shaders)
endif()
endfunction()
\ No newline at end of file
......@@ -377,11 +377,23 @@ install(
Devel
)
#--------------------------------------------------------------------------
# Test data download
#--------------------------------------------------------------------------
include(imstkExternalDataDownloadTest)
#--------------------------------------------------------------------------
# Add Examples subdirectories
#--------------------------------------------------------------------------
if(BUILD_EXAMPLES)
add_subdirectory(Examples)
add_subdirectory(Examples)
endif()
#-----------------------------------------------------------------------------
# Download the external data needed for both testing and examples
#-----------------------------------------------------------------------------
if(BUILD_TESTING OR BUILD_EXAMPLES)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
endif()
#--------------------------------------------------------------------------
......@@ -390,4 +402,4 @@ endif()
add_test(
NAME imstkDummyTest
COMMAND ${CMAKE_COMMAND} -E echo "Success"
)
)
\ No newline at end of file
......@@ -124,10 +124,10 @@ int main()
logger->createLogger("audio-Example", "./");
#ifndef iMSTK_AUDIO_ENABLED
LOG(INFO) << "Audio not enabled at build time\n";
return 1;
LOG(INFO) << "Audio not enabled at build time\n";
return 1;
#endif
LOG(INFO) << "--Testing audio--\n";
// Test a sound
......
......@@ -34,10 +34,18 @@ else()
SimulationManager
SFML)
endif()
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
list(APPEND FILE_LIST
sound/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
......
......@@ -36,6 +36,12 @@ if(iMSTK_USE_OMNI)
SimulationManager
SFML)
endif()
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
......
#-----------------------------------------------------------------------------
# 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
)
#-----------------------------------------------------------------------------
# Add Example subdirectories
#-----------------------------------------------------------------------------
macro(listOfSubDir result curdir)
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist ${child})
endif()
endforeach()
set(${result} ${dirlist})
endmacro()
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist ${child})
endif()
endforeach()
set(${result} ${dirlist})
endmacro()
listOfSubDir(subDirs ${CMAKE_CURRENT_SOURCE_DIR})
listOfSubDir(subDirs ${CMAKE_CURRENT_SOURCE_DIR})
foreach(subdir ${subDirs})
add_subdirectory(${subdir})
foreach(subdir ${subDirs})
add_subdirectory(${subdir})
endforeach()
#-----------------------------------------------------------------------------
# Shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
\ No newline at end of file
......@@ -28,6 +28,12 @@ if(iMSTK_USE_OMNI)
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
......
......@@ -41,8 +41,8 @@ using namespace imstk;
int main()
{
#ifndef iMSTK_USE_OPENHAPTICS
std::cout << "Audio not enabled at build time" << std::endl;
return 1;
std::cout << "Audio not enabled at build time" << std::endl;
return 1;
#endif
// Create SDK and Scene
......@@ -73,7 +73,7 @@ int main()
cam->setPosition(Vec3d(0, 0, 10));
#ifdef iMSTK_USE_OPENHAPTICS
auto camControllerInput = std::make_shared<CameraController>(*cam, client);
// Set camera controller
......
......@@ -27,6 +27,12 @@ add_executable(${PROJECT_NAME} DeformableBody.cpp)
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
......
......@@ -159,6 +159,6 @@ int main()
// Run the simulation
sdk->setActiveScene(scene);
sdk->startSimulation(SimulationStatus::PAUSED);
return 0;
}
......@@ -22,6 +22,12 @@ project(Example-ExtractSurface)
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} ExtractSurface.cpp)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Link libraries to executable
......
......@@ -27,6 +27,12 @@ add_executable(${PROJECT_NAME} GeometryTransforms.cpp)
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
......
......@@ -27,6 +27,12 @@ add_executable(${PROJECT_NAME} Graph.cpp)
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
......
......@@ -28,6 +28,12 @@ if(iMSTK_USE_OMNI)
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
......
......@@ -27,7 +27,13 @@ add_executable(${PROJECT_NAME} MeshIO.cpp)
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
......
......@@ -28,6 +28,12 @@ add_executable(${PROJECT_NAME} MshVegaIO.cpp)
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
......
......@@ -24,6 +24,12 @@ if(iMSTK_USE_OMNI)
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} ObjectController.cpp)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
......
......@@ -23,6 +23,12 @@ project(Example-PBDCloth)
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} pbdClothExample.cpp)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
......
......@@ -23,6 +23,12 @@ project(Example-PBDCollision)
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} PBDCollisionExample.cpp)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment