From 5d90e38e4af6aad77ff90e3ea7c833c102794a94 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 30 Jul 2024 11:41:22 -0600 Subject: [PATCH] Enforce order dependency on tests to avoid race condition where reading test ran before writing test. --- examples/F77/CMakeLists.txt | 9 +++++---- examples/F90/CMakeLists.txt | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/F77/CMakeLists.txt b/examples/F77/CMakeLists.txt index e2469b48..433cfbeb 100644 --- a/examples/F77/CMakeLists.txt +++ b/examples/F77/CMakeLists.txt @@ -19,10 +19,11 @@ FOREACH(F ${example_F77_tests}) ENDIF() ENDFOREACH() -## Specify files to be distributed by 'make dist' -FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.F ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) -SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am) -ADD_EXTRA_DIST("${CUR_EXTRA_DIST}") +# Set some order dependencies on tests +set_tests_properties(F77_tests_simple_xy_rd PROPERTIES DEPENDS "F77_tests_simple_xy_wr") +set_tests_properties(F77_tests_sfc_pres_temp_rd PROPERTIES DEPENDS "F77_tests_sfc_pres_temp_wr") +set_tests_properties(F77_tests_pres_temp_4D_rd PROPERTIES DEPENDS "F77_tests_pres_temp_4D_wr") + SET(CLEANFILES sfc_pres_temp.nc simple_xy.nc pres_temp_4D.nc simple_nc4.nc simple_xy_nc4.nc) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}") diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 2b8eaf03..39e410c7 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -30,9 +30,14 @@ IF(TEST_PARALLEL) build_bin_test(simple_xy_par_wr .F90) build_bin_test(simple_xy_par_rd .F90) build_bin_test(simple_xy_par_wr2 .F90) + add_sh_test(f90_tests run_f90_par_examples) ENDIF(TEST_PARALLEL) +# Set some order dependencies on tests +set_tests_properties(F90_tests_simple_xy_rd PROPERTIES DEPENDS "F90_tests_simple_xy_wr") +set_tests_properties(F90_tests_sfc_pres_temp_rd PROPERTIES DEPENDS "F90_tests_sfc_pres_temp_wr") +set_tests_properties(F90_tests_pres_temp_4D_rd PROPERTIES DEPENDS "F90_tests_pres_temp_4D_wr") SET(CLEANFILES sfc_pres_temp.nc simple_xy.nc pres_temp_4D.nc simple_nc4.nc simple_xy_nc4.nc) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")