|
26 | 26 |
|
27 | 27 | module procedure co_characterize |
28 | 28 |
|
29 | | - logical i_skipped, i_passed |
| 29 | + logical i_passed |
30 | 30 | integer, parameter :: skips=1, passes=2 |
31 | 31 | integer tally(skips:passes) |
32 | 32 | character(len=*), parameter :: indent = " " |
33 | 33 |
|
34 | | - i_skipped = .not. allocated(self%diagnosis_) |
| 34 | + associate(i_skipped => .not. allocated(self%diagnosis_)) |
35 | 35 |
|
36 | | - if (i_skipped) then |
37 | | - i_passed = .false. |
38 | | - else |
39 | | - i_passed = self%diagnosis_%test_passed() |
40 | | - end if |
41 | | - |
42 | | - tally = [merge(1,0,i_skipped), merge(1,0,i_passed)] |
43 | | - call co_sum(tally) |
44 | | - |
45 | | - associate(me => this_image(), images => num_images(), images_skipped => tally(skips), images_passed => tally(passes)) |
46 | | - call_julienne_assert(any(images_skipped == [0,images])) |
47 | 36 | if (i_skipped) then |
48 | | - if (me==1) print '(a)', indent // "SKIPS on " // trim(self%description_%string()) // "." |
| 37 | + i_passed = .false. |
49 | 38 | else |
50 | | - if (me==1) print '(a)', indent // merge("passes on ", "FAILS on ", images_passed == images) // trim(self%description_%string()) // "." |
| 39 | + i_passed = self%diagnosis_%test_passed() |
| 40 | + end if |
| 41 | + |
| 42 | + tally = [merge(1,0,i_skipped), merge(1,0,i_passed)] |
| 43 | + call co_sum(tally) |
| 44 | + |
| 45 | + associate(me => this_image(), images => num_images(), images_skipped => tally(skips), images_passed => tally(passes)) |
| 46 | + call_julienne_assert(any(images_skipped == [0,images])) |
| 47 | + if (i_skipped) then |
| 48 | + if (me==1) print '(a)', indent // "SKIPS on " // trim(self%description_%string()) // "." |
| 49 | + else |
| 50 | + if (me==1) print '(a)', indent // merge("passes on ", "FAILS on ", images_passed == images) // trim(self%description_%string()) // "." |
51 | 51 | #if ! ASYNCHRONOUS_DIAGNOSTICS |
52 | | - sync all |
| 52 | + sync all ! ensure image 1 reports/prints outcome before any failure diagnostics print |
53 | 53 | #endif |
54 | | - if ((.not. i_skipped) .and. (.not. i_passed)) then |
55 | | - associate(image => string_t(me)) |
56 | | - print '(a)', indent // indent // "diagnostics on image " // image%string() // ": " // self%diagnosis_%diagnostics_string() |
57 | | - end associate |
58 | | - end if |
| 54 | + if ((.not. i_skipped) .and. (.not. i_passed)) then |
| 55 | + associate(image => string_t(me)) |
| 56 | + print '(a)', indent // indent // "diagnostics on image " // image%string() // ": " // self%diagnosis_%diagnostics_string() |
| 57 | + end associate |
| 58 | + end if |
59 | 59 | #if ! ASYNCHRONOUS_DIAGNOSTICS |
60 | | - sync all |
| 60 | + sync all ! ensure all images print failure diagnostics, if any, before any image moves on to the next test |
61 | 61 | #endif |
62 | | - end if |
| 62 | + end if |
| 63 | + end associate |
63 | 64 | end associate |
64 | 65 | end procedure |
65 | 66 |
|
|
0 commit comments