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

Added mpirun-wrapper.

parent be1bdf95
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ function (AddTest) ...@@ -26,7 +26,7 @@ function (AddTest)
# parse arguments # parse arguments
set(options NONE) set(options NONE)
set(oneValueArgs EXECUTABLE PATH NAME WRAPPER TESTER) set(oneValueArgs EXECUTABLE PATH NAME WRAPPER TESTER)
set(multiValueArgs EXECUTABLE_ARGS DATA DIFF_DATA) set(multiValueArgs EXECUTABLE_ARGS DATA DIFF_DATA WRAPPER_ARGS)
cmake_parse_arguments(AddTest "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(AddTest "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# set defaults # set defaults
...@@ -63,6 +63,9 @@ function (AddTest) ...@@ -63,6 +63,9 @@ function (AddTest)
if(AddTest_WRAPPER STREQUAL "callgrind" AND NOT VALGRIND_TOOL_PATH) if(AddTest_WRAPPER STREQUAL "callgrind" AND NOT VALGRIND_TOOL_PATH)
message(FATAL_ERROR "Valgrind is required for callgrind wrapper but was not found!") message(FATAL_ERROR "Valgrind is required for callgrind wrapper but was not found!")
endif() endif()
if(AddTest_WRAPPER STREQUAL "mpirun" AND NOT MPIRUN_TOOL_PATH)
message(FATAL_ERROR "mpirun is required for mpirun wrapper but was not found!")
endif()
if(AddTest_WRAPPER STREQUAL "time") if(AddTest_WRAPPER STREQUAL "time")
set(WRAPPER_COMMAND time) set(WRAPPER_COMMAND time)
...@@ -72,6 +75,8 @@ function (AddTest) ...@@ -72,6 +75,8 @@ function (AddTest)
elseif(AddTest_WRAPPER STREQUAL "callgrind" AND VALGRIND_TOOL_PATH) elseif(AddTest_WRAPPER STREQUAL "callgrind" AND VALGRIND_TOOL_PATH)
set(WRAPPER_COMMAND "${VALGRIND_TOOL_PATH} --tool=callgrind --branch-sim=yes --cache-sim=yes --dump-instr=yes --collect-jumps=yes") set(WRAPPER_COMMAND "${VALGRIND_TOOL_PATH} --tool=callgrind --branch-sim=yes --cache-sim=yes --dump-instr=yes --collect-jumps=yes")
unset(tester) unset(tester)
elseif(AddTest_WRAPPER STREQUAL "mpirun")
set(WRAPPER_COMMAND "${MPIRUN_TOOL_PATH} ${AddTest_WRAPPER_ARGS}")
endif() endif()
# --- Implement testers --- # --- Implement testers ---
......
...@@ -5,6 +5,7 @@ SET(TIME_TOOL_PATH time) ...@@ -5,6 +5,7 @@ SET(TIME_TOOL_PATH time)
FIND_PROGRAM(GREP_TOOL_PATH grep) FIND_PROGRAM(GREP_TOOL_PATH grep)
FIND_PROGRAM(BASH_TOOL_PATH bash) FIND_PROGRAM(BASH_TOOL_PATH bash)
FIND_PROGRAM(VALGRIND_TOOL_PATH valgrind) FIND_PROGRAM(VALGRIND_TOOL_PATH valgrind)
FIND_PROGRAM(MPIRUN_TOOL_PATH mpirun)
ENABLE_TESTING() # Enable CTest ENABLE_TESTING() # Enable CTest
......
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