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

[CTest] Only print warning and disable wrapper if req. not met.

parent 8907f9f9
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# PATH <working directory> # relative to SourceDir/Tests/Data # PATH <working directory> # relative to SourceDir/Tests/Data
# EXECUTABLE <executable target> # optional, defaults to ogs # EXECUTABLE <executable target> # optional, defaults to ogs
# EXECUTABLE_ARGS <arguments> # EXECUTABLE_ARGS <arguments>
# WRAPPER <time|memcheck|callgrind> # optional # WRAPPER <time|memcheck|callgrind|mpirun> # optional
# WRAPPER_ARGS <arguments> # optional # WRAPPER_ARGS <arguments> # optional
# TESTER <diff|vtkdiff|memcheck> # optional # TESTER <diff|vtkdiff|memcheck> # optional
# REQUIREMENTS # optional simple boolean expression which has to be true to # REQUIREMENTS # optional simple boolean expression which has to be true to
...@@ -67,29 +67,37 @@ function (AddTest) ...@@ -67,29 +67,37 @@ function (AddTest)
message(STATUS "Requirement ${AddTest_REQUIREMENTS} not met! Disabling test ${AddTest_NAME}.") message(STATUS "Requirement ${AddTest_REQUIREMENTS} not met! Disabling test ${AddTest_NAME}.")
return() return()
endif() endif()
if(AddTest_WRAPPER STREQUAL "time" AND NOT TIME_TOOL_PATH)
return()
endif()
if(AddTest_WRAPPER STREQUAL "memcheck" AND NOT VALGRIND_TOOL_PATH)
return()
endif()
if(AddTest_WRAPPER STREQUAL "callgrind" AND NOT VALGRIND_TOOL_PATH)
return()
endif()
if(AddTest_WRAPPER STREQUAL "mpirun" AND NOT MPIRUN_TOOL_PATH)
return()
endif()
if(AddTest_WRAPPER STREQUAL "time") if(AddTest_WRAPPER STREQUAL "time")
set(WRAPPER_COMMAND time) if(TIME_TOOL_PATH)
elseif(AddTest_WRAPPER STREQUAL "memcheck" AND VALGRIND_TOOL_PATH) set(WRAPPER_COMMAND time)
set(WRAPPER_COMMAND "${VALGRIND_TOOL_PATH} --tool=memcheck --log-file=${AddTest_SOURCE_PATH}/${AddTest_NAME}_memcheck.log -v --leak-check=full --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xff") else()
set(tester memcheck) message(STATUS "WARNING: Disabling time wrapper for ${AddTest_NAME} as time exe was not found!")
elseif(AddTest_WRAPPER STREQUAL "callgrind" AND VALGRIND_TOOL_PATH) set(AddTest_WRAPPER_ARGS "")
set(WRAPPER_COMMAND "${VALGRIND_TOOL_PATH} --tool=callgrind --branch-sim=yes --cache-sim=yes --dump-instr=yes --collect-jumps=yes") endif()
unset(tester) elseif(AddTest_WRAPPER STREQUAL "memcheck")
if(VALGRIND_TOOL_PATH)
set(WRAPPER_COMMAND "${VALGRIND_TOOL_PATH} --tool=memcheck --log-file=${AddTest_SOURCE_PATH}/${AddTest_NAME}_memcheck.log -v --leak-check=full --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xff")
set(tester memcheck)
else()
message(STATUS "WARNING: Disabling memcheck wrapper for ${AddTest_NAME} as memcheck exe was not found!")
set(AddTest_WRAPPER_ARGS "")
endif()
elseif(AddTest_WRAPPER STREQUAL "callgrind")
if(VALGRIND_TOOL_PATH)
set(WRAPPER_COMMAND "${VALGRIND_TOOL_PATH} --tool=callgrind --branch-sim=yes --cache-sim=yes --dump-instr=yes --collect-jumps=yes")
unset(tester)
else()
message(STATUS "WARNING: Disabling callgrind wrapper for ${AddTest_NAME} as callgrind exe was not found!")
set(AddTest_WRAPPER_ARGS "")
endif()
elseif(AddTest_WRAPPER STREQUAL "mpirun") elseif(AddTest_WRAPPER STREQUAL "mpirun")
set(WRAPPER_COMMAND ${MPIRUN_TOOL_PATH}) if(MPIRUN_TOOL_PATH)
set(WRAPPER_COMMAND ${MPIRUN_TOOL_PATH})
else()
message(STATUS "ERROR: mpirun was not found but is required for ${AddTest_NAME}!")
return()
endif()
endif() endif()
# --- Implement testers --- # --- Implement testers ---
......
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