Skip to content

Commit

Permalink
cache NEXUS_TESTLIST
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Hahn <hahnse@ornl.gov>
  • Loading branch information
quantumsteve committed Jan 5, 2022
1 parent fbbe1d0 commit a54ae6f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nexus/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ check_python_reqs(numpy "nexus base" ADD_TEST)

if(ADD_TEST)
message("Adding Nexus tests")
set(TESTLIST "")
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/nexus/bin/nxs-test --ctestlist OUTPUT_VARIABLE TESTLIST)
#MESSAGE(" Nexus tests: ${TESTLIST}")
foreach(TESTNAME ${TESTLIST})
file(TIMESTAMP ${PROJECT_SOURCE_DIR}/nexus/bin/nxs-test NEXUS_TESTLIST_TIMESTAMP)
if(NOT "${NEXUS_TESTLIST_TIMESTAMP}" STREQUAL "${CACHE_NEXUS_TESTLIST_TIMESTAMP}")
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/nexus/bin/nxs-test --ctestlist OUTPUT_VARIABLE NEXUS_TESTLIST)
set(CACHE_NEXUS_TESTLIST ${NEXUS_TESTLIST} CACHE INTERNAL "NEXUS_TESTLIST cache variable" FORCE)
set(CACHE_NEXUS_TESTLIST_TIMESTAMP ${NEXUS_TESTLIST_TIMESTAMP} CACHE INTERNAL "Timestamp used to validate NEXUS_TESTLIST cache variables" FORCE)
else()
set(NEXUS_TESTLIST ${CACHE_NEXUS_TESTLIST})
endif()
foreach(TESTNAME ${NEXUS_TESTLIST})
#message("Adding test ntest_nexus_${TESTNAME}")
set(NTEST "${qmcpack_SOURCE_DIR}/nexus/bin/nxs-test")
add_test(NAME ntest_nexus_${TESTNAME} COMMAND ${NTEST} -R ${TESTNAME}\$ --ctest
Expand Down

0 comments on commit a54ae6f

Please sign in to comment.