mirror of https://github.com/QMCPACK/qmcpack.git
Add file existence tests.
This commit is contained in:
parent
f0b740b379
commit
8b42da1bd5
|
@ -654,3 +654,16 @@ function(
|
||||||
set_property(TEST ${FULLNAME} APPEND PROPERTY PASS_REGULAR_EXPRESSION "Time limit reached for")
|
set_property(TEST ${FULLNAME} APPEND PROPERTY PASS_REGULAR_EXPRESSION "Time limit reached for")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Add a test to see if a file exists in the desired location.
|
||||||
|
function(add_test_check_file_existence TEST_DEP_IN FILE_NAME SHOULD_SUCCEED)
|
||||||
|
if(TEST ${TEST_DEP_IN})
|
||||||
|
get_test_property(${TEST_DEP_IN} WORKING_DIRECTORY TEST_DEP_IN_WORK_DIR)
|
||||||
|
set(TESTNAME ${TEST_DEP_IN}-exists-${FILE_NAME})
|
||||||
|
add_test(NAME ${TESTNAME} COMMAND ls ${TEST_DEP_IN_WORK_DIR}/${FILE_NAME})
|
||||||
|
if (NOT SHOULD_SUCCEED)
|
||||||
|
set_property(TEST ${TESTNAME} PROPERTY WILL_FAIL TRUE)
|
||||||
|
endif()
|
||||||
|
set_tests_properties(${TESTNAME} PROPERTIES DEPENDS ${TEST_DEP_IN})
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
|
@ -107,6 +107,12 @@ if(NOT QMC_CUDA)
|
||||||
2
|
2
|
||||||
check.sh
|
check.sh
|
||||||
false)
|
false)
|
||||||
|
|
||||||
|
add_test_check_file_existence(deterministic-restart_batch-8-2 qmc_short_batch.s000.config.h5 TRUE)
|
||||||
|
add_test_check_file_existence(deterministic-restart_batch-8-2 qmc_short_batch.s000.random.h5 TRUE)
|
||||||
|
add_test_check_file_existence(deterministic-restart_batch-8-2 qmc_short_batch.s001.config.h5 FALSE)
|
||||||
|
add_test_check_file_existence(deterministic-restart_batch-8-2 qmc_short_batch.s001.random.h5 FALSE)
|
||||||
|
|
||||||
run_restart_and_check(
|
run_restart_and_check(
|
||||||
deterministic-restart_batch
|
deterministic-restart_batch
|
||||||
"${qmcpack_SOURCE_DIR}/tests/io/restart_batch"
|
"${qmcpack_SOURCE_DIR}/tests/io/restart_batch"
|
||||||
|
|
Loading…
Reference in New Issue