Skip to content
Snippets Groups Projects
Commit fa4161a1 authored by Timo Koch's avatar Timo Koch
Browse files

[cmake][dune_add_test] Overwrite command and cmd_args if a cmake guard is false

If a complicated user defined command was specified, it didn't lead to the dummy
executable (that return 77) being run but the user defined command instead. This
patch makes sure that the correct command is executed which then marks the test
as skipped and not as failed. If a test is a parallel and tested with multiple
number of ranks all these test are shown as skipped.
parent 63442e16
No related branches found
No related tags found
No related merge requests found
......@@ -297,6 +297,12 @@ function(dune_add_test)
set(ACTUAL_TESTCOMMAND "${MPIEXEC}")
endif()
# if this is a skipped test because a guard was false, overwrite the command
if(SHOULD_SKIP_TEST)
set(ACTUAL_TESTCOMMAND ${CMAKE_CURRENT_BINARY_DIR}/${ADDTEST_NAME})
set(ACTUAL_CMD_ARGS)
endif()
# Now add the actual test
_add_test(NAME ${ACTUAL_NAME}
COMMAND "${ACTUAL_TESTCOMMAND}" ${ACTUAL_CMD_ARGS}
......
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