Skip to content
Snippets Groups Projects
Commit db330fdd authored by Lars Bilke's avatar Lars Bilke Committed by Lars Bilke
Browse files

[CMake] Introduced optional VIS parameter on AddTest().

Specify one or more files which be converted to vtk.js if
vtkDataConverter is found.

https://github.com/Kitware/vtk-js/issues/3#issuecomment-230389315
parent 8d9ed595
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,8 @@ foreach(mesh_size 1e0 1e1 1e2 1e3) ...@@ -34,6 +34,8 @@ foreach(mesh_size 1e0 1e1 1e2 1e3)
ABSTOL 1e-1 RELTOL 1e-1 ABSTOL 1e-1 RELTOL 1e-1
DIFF_DATA DIFF_DATA
cube_1x1x1_hex_${mesh_size}.vtu cube_${mesh_size}_neumann_pcs_0_ts_1_t_1.000000.vtu D1_left_front_N1_right pressure cube_1x1x1_hex_${mesh_size}.vtu cube_${mesh_size}_neumann_pcs_0_ts_1_t_1.000000.vtu D1_left_front_N1_right pressure
VIS
cube_${mesh_size}_neumann_pcs_0_ts_1_t_1.000000.vtu
) )
endforeach() endforeach()
...@@ -558,5 +560,3 @@ foreach(mesh_size 1e1) ...@@ -558,5 +560,3 @@ foreach(mesh_size 1e1)
line_1_line_${mesh_size}.vtu line_${mesh_size}_neumann_pcs_0_ts_1_t_1_000000_0.vtu D1_left_N1_right pressure line_1_line_${mesh_size}.vtu line_${mesh_size}_neumann_pcs_0_ts_1_t_1_000000_0.vtu D1_left_N1_right pressure
) )
endforeach() endforeach()
...@@ -64,6 +64,8 @@ if(CCACHE_FOUND) ...@@ -64,6 +64,8 @@ if(CCACHE_FOUND)
endif() endif()
endif(CCACHE_FOUND) endif(CCACHE_FOUND)
find_program(VTKJS_CONVERTER vtkDataConverter)
###################### ######################
### Find libraries ### ### Find libraries ###
###################### ######################
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# REQUIREMENTS # optional simple boolean expression which has to be true to # REQUIREMENTS # optional simple boolean expression which has to be true to
# enable the test, e.g. # enable the test, e.g.
# OGS_USE_PETSC AND (OGS_USE_EIGEN OR OGS_USE_LIS) # OGS_USE_PETSC AND (OGS_USE_EIGEN OR OGS_USE_LIS)
# VIS <vtu output file(s)> # optional for documentation
# ) # )
# #
# Conditional arguments: # Conditional arguments:
...@@ -36,7 +37,7 @@ function (AddTest) ...@@ -36,7 +37,7 @@ function (AddTest)
# parse arguments # parse arguments
set(options NONE) set(options NONE)
set(oneValueArgs EXECUTABLE PATH NAME WRAPPER TESTER ABSTOL RELTOL) set(oneValueArgs EXECUTABLE PATH NAME WRAPPER TESTER ABSTOL RELTOL)
set(multiValueArgs EXECUTABLE_ARGS DATA DIFF_DATA WRAPPER_ARGS REQUIREMENTS) set(multiValueArgs EXECUTABLE_ARGS DATA DIFF_DATA WRAPPER_ARGS REQUIREMENTS VIS)
cmake_parse_arguments(AddTest "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(AddTest "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
...@@ -214,6 +215,9 @@ function (AddTest) ...@@ -214,6 +215,9 @@ function (AddTest)
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-Dcase_path=${AddTest_SOURCE_PATH} -Dcase_path=${AddTest_SOURCE_PATH}
-DTESTER_COMMAND=${TESTER_COMMAND} -DTESTER_COMMAND=${TESTER_COMMAND}
-DVTKJS_CONVERTER=${VTKJS_CONVERTER}
-DBINARY_PATH=${AddTest_BINARY_PATH}
"-DVIS_FILES=${AddTest_VIS}"
-P ${PROJECT_SOURCE_DIR}/scripts/cmake/test/AddTestTester.cmake -P ${PROJECT_SOURCE_DIR}/scripts/cmake/test/AddTestTester.cmake
) )
set_tests_properties(${TESTER_NAME} PROPERTIES DEPENDS ${TEST_NAME}) set_tests_properties(${TESTER_NAME} PROPERTIES DEPENDS ${TEST_NAME})
......
...@@ -17,3 +17,10 @@ endif() ...@@ -17,3 +17,10 @@ endif()
if(NOT EXIT_CODE STREQUAL "0") if(NOT EXIT_CODE STREQUAL "0")
message(FATAL_ERROR "Error exit code: ${EXIT_CODE}") message(FATAL_ERROR "Error exit code: ${EXIT_CODE}")
endif() endif()
# Run vtk.js converter
foreach(FILE ${VIS_FILES})
execute_process(
COMMAND ${VTKJS_CONVERTER} -e -i ${BINARY_PATH}/${FILE} -o ${BINARY_PATH}/vtk-js
)
endforeach()
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