Skip to content

Commit 2a3521d

Browse files
committed
co_characterize: propagate a failure on any image to a failure on all images
1 parent 0f3d987 commit 2a3521d

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/julienne/julienne_test_result_m.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ elemental module function construct_from_character(description, diagnosis) resul
5252
module subroutine co_characterize(self)
5353
!! Print a description of the test, its outcome, and diagnostic information if the test fails
5454
implicit none
55-
class(test_result_t), intent(in) :: self
55+
class(test_result_t), intent(inout) :: self
5656
end subroutine
5757

5858
impure elemental module function passed(self) result(test_passed)

src/julienne/julienne_test_result_s.F90

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@
4747
if (i_skipped) then
4848
if (me==1) print '(a)', indent // "SKIPS on " // trim(self%description_%string()) // "."
4949
else
50-
if (me==1) print '(a)', indent // merge("passes on ", "FAILS on ", images_passed == images) // trim(self%description_%string()) // "."
50+
if (images_passed < images .and. i_passed) then
51+
! a failure on any image becomes a failure on all images
52+
self%diagnosis_ = test_diagnosis_t(test_passed=.false., diagnostics_string="peer image failure")
53+
end if
54+
if (me==1) print '(a)', indent // merge("passes on ", "FAILS on ", self%diagnosis_%test_passed()) // trim(self%description_%string()) // "."
5155
#if ! ASYNCHRONOUS_DIAGNOSTICS
5256
sync all ! ensure image 1 prints test outcome before any failure diagnostics print
5357
#endif

src/julienne/julienne_test_s.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
integer t
3333
logical, allocatable :: passing_tests(:), skipped_tests(:)
34+
type(test_result_t), allocatable :: test_results(:)
3435

3536
#if HAVE_MULTI_IMAGE_SUPPORT
3637
associate(me => this_image())
@@ -39,16 +40,16 @@
3940
#endif
4041
if (me==1) print '(a)', new_line('') // test%subject()
4142

42-
associate(test_results => test%results())
43+
test_results = test%results()
4344

44-
passing_tests = test_results%passed()
45-
skipped_tests = test_results%skipped()
45+
skipped_tests = test_results%skipped()
4646

47-
associate(num_tests => size(test_results))
47+
associate(num_tests => size(test_results))
4848

4949
do t = 1, num_tests
5050
call test_results(t)%co_characterize()
5151
end do
52+
passing_tests = test_results%passed() ! may be altered by co_characterize
5253

5354
tests = tests + num_tests
5455

@@ -57,7 +58,6 @@
5758
passes = passes + num_passes
5859
skips = skips + num_skipped
5960
end associate
60-
end associate
6161
end associate
6262
end associate
6363
end procedure

0 commit comments

Comments
 (0)