Skip to content

Commit

Permalink
Enforce order dependency on tests to avoid race condition where readi…
Browse files Browse the repository at this point in the history
…ng test ran before writing test.
  • Loading branch information
WardF committed Jul 30, 2024
1 parent 6302daa commit 5d90e38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/F77/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
5 changes: 5 additions & 0 deletions examples/F90/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

0 comments on commit 5d90e38

Please sign in to comment.