Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache nexus testlist to save ~1s configuration time #3706

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ${qmcpack_SOURCE_DIR}/nexus/bin/nxs-test NEXUS_TESTLIST_TIMESTAMP)
if(NOT "${NEXUS_TESTLIST_TIMESTAMP}" STREQUAL "${CACHE_NEXUS_TESTLIST_TIMESTAMP}")
execute_process(COMMAND ${qmcpack_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