added: support restart tests
these are tests where the output from a restarted simulation is tested against a stored reference.
This commit is contained in:
parent
3714bf7838
commit
5fcd5fecae
@ -17,8 +17,19 @@ mysim=$1
|
||||
cd `dirname $2`
|
||||
MAPFILE=`head -n1 $2`
|
||||
test $? -eq 0 || exit 1
|
||||
test -n "$3" && mysim="mpirun -n $3 $mysim"
|
||||
$mysim $MAPFILE 2>&1 > @CMAKE_BINARY_DIR@/templog
|
||||
if test -z "$4"
|
||||
then
|
||||
test -n "$3" && mysim="mpirun -n $3 $mysim"
|
||||
else
|
||||
test -n "$5" && mysim="mpirun -n $5 $mysim"
|
||||
fi
|
||||
hdf5=""
|
||||
test -n "$4" && hdf5="-hdf5 @CMAKE_BINARY_DIR@/Testing/$3"
|
||||
$mysim $hdf5 $MAPFILE 2>&1 > @CMAKE_BINARY_DIR@/templog
|
||||
if test -n "$4"
|
||||
then
|
||||
$mysim $MAPFILE -restart @CMAKE_BINARY_DIR@/Testing/$3_restart.hdf5 $4 2>&1 > @CMAKE_BINARY_DIR@/templog
|
||||
fi
|
||||
appres=$?
|
||||
globres=1
|
||||
IFS=$'\n'
|
||||
|
@ -103,6 +103,23 @@ function(IFEM_add_test name binary)
|
||||
endif(IFEM_TEST_MEMCHECK)
|
||||
endfunction()
|
||||
|
||||
function(IFEM_add_restart_test name binary rlevel)
|
||||
separate_arguments(MEMCHECK_COMMAND)
|
||||
if(IFEM_TEST_EXTRA)
|
||||
set(test-name "restart+${binary}+${IFEM_TEST_EXTRA}+${name}")
|
||||
else()
|
||||
set(test-name "restart+${binary}+${name}")
|
||||
endif()
|
||||
string(REGEX MATCH "^(.*)\\.[^.]*$" dummy ${name})
|
||||
set(rfile ${CMAKE_MATCH_1})
|
||||
get_filename_component(rfile ${rfile} NAME)
|
||||
if(IFEM_TEST_MEMCHECK)
|
||||
add_test("${test-name}" regtest.sh "${MEMCHECK_COMMAND} --log-file=${CMAKE_BINARY_DIR}/valgrindlog ${EXECUTABLE_OUTPUT_PATH}/${binary}" ${PROJECT_SOURCE_DIR}/${TEST_SUBDIR}/Test/${name} ${rfile} ${rlevel} ${ARGN})
|
||||
else(IFEM_TEST_MEMCHECK)
|
||||
add_test("${test-name}" regtest.sh ${EXECUTABLE_OUTPUT_PATH}/${binary} ${PROJECT_SOURCE_DIR}/${TEST_SUBDIR}/Test/${name} ${rfile} ${rlevel} ${ARGN})
|
||||
endif(IFEM_TEST_MEMCHECK)
|
||||
endfunction()
|
||||
|
||||
macro(add_check_target)
|
||||
add_custom_target(check ${CMAKE_CTEST_COMMAND} WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
add_custom_command(TARGET check PRE_BUILD COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/failed.log)
|
||||
|
Loading…
Reference in New Issue
Block a user