@@ -465,7 +465,7 @@ function(add_mpi_test name num_mpi_proc path)
465465 set_property (TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
466466endfunction (add_mpi_test)
467467
468- function (add_mpi_failable_test name num_mpi_proc path )
468+ function (add_fault_tolerant_mpi_test name num_mpi_proc path )
469469 if ( ((N LESS num_mpi_proc) OR (N EQUAL 0)) )
470470 message (STATUS "Test ${name} is oversubscribed: ${num_mpi_proc} ranks requested with ${N} system processor available." )
471471 if ( openmpi )
@@ -481,7 +481,7 @@ function(add_mpi_failable_test name num_mpi_proc path)
481481 set (test_parameters ${test_parameters} ${MPIEXEC_NUMPROC_FLAG} ${num_mpi_proc} -disable-auto-cleanup )
482482 add_test (NAME ${name} COMMAND ${MPIEXEC} ${test_parameters} "${path} " )
483483 set_property (TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
484- endfunction (add_mpi_failable_test )
484+ endfunction (add_fault_tolerant_mpi_test )
485485
486486set (tests_root ${CMAKE_CURRENT_BINARY_DIR} /src/tests)
487487
@@ -551,20 +551,22 @@ if(opencoarrays_aware_compiler)
551551 add_mpi_test(co_reduce_string 4 ${tests_root} /unit/collectives/co_reduce_string)
552552
553553 # IMAGE FAIL tests
554- add_mpi_test(image_status_test_1 4 ${tests_root} /unit/fail_images/image_status_test_1)
555- #ifdef WITH_FAIL_IMAGES
556- # No other way to check that image_fail_test_1 passes.
557- add_mpi_failable_test(image_fail_test_1 4 ${tests_root} /unit/fail_images/image_fail_test_1)
558- set_property (TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed" )
559- set_property (TEST image_fail_test_1 PROPERTY PASS_REGULAR_EXPRESSION "Test passed" )
560- add_mpi_failable_test(image_fail_and_sync_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_1)
561- add_mpi_failable_test(image_fail_and_sync_test_2 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_2)
562- add_mpi_failable_test(image_fail_and_sync_test_3 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_3)
563- add_mpi_failable_test(image_fail_and_status_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_status_test_1)
564- add_mpi_failable_test(image_fail_and_failed_images_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_failed_images_test_1)
565- add_mpi_failable_test(image_fail_and_stopped_images_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_stopped_images_test_1)
566- add_mpi_failable_test(image_fail_and_get_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_get_test_1)
567- #endif
554+ if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7)
555+ add_mpi_test(image_status_test_1 4 ${tests_root} /unit/fail_images/image_status_test_1)
556+ if (CAF_ENABLE_FAILED_IMAGES)
557+ # No other way to check that image_fail_test_1 passes.
558+ add_fault_tolerant_mpi_test(image_fail_test_1 4 ${tests_root} /unit/fail_images/image_fail_test_1)
559+ set_property (TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed" )
560+ set_property (TEST image_fail_test_1 PROPERTY PASS_REGULAR_EXPRESSION "Test passed" )
561+ add_fault_tolerant_mpi_test(image_fail_and_sync_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_1)
562+ add_fault_tolerant_mpi_test(image_fail_and_sync_test_2 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_2)
563+ add_fault_tolerant_mpi_test(image_fail_and_sync_test_3 4 ${tests_root} /unit/fail_images/image_fail_and_sync_test_3)
564+ add_fault_tolerant_mpi_test(image_fail_and_status_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_status_test_1)
565+ add_fault_tolerant_mpi_test(image_fail_and_failed_images_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_failed_images_test_1)
566+ add_fault_tolerant_mpi_test(image_fail_and_stopped_images_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_stopped_images_test_1)
567+ add_fault_tolerant_mpi_test(image_fail_and_get_test_1 4 ${tests_root} /unit/fail_images/image_fail_and_get_test_1)
568+ endif ()
569+ endif ()
568570else ()
569571 add_test (co_sum_extension ${tests_root} /unit/extensions/test -co_sum-extension.sh)
570572 set_property (TEST co_sum_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
0 commit comments