Skip to content

Commit

Permalink
Merge pull request #482 from Goddard-Fortran-Ecosystem/hotfix/gfortra…
Browse files Browse the repository at this point in the history
…n-workaround

Workaround for gfortran
  • Loading branch information
tclune authored Feb 5, 2025
2 parents 66f77f2 + ce9bbe2 commit cbe21b9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.12)

project (PFUNIT
VERSION 4.11.0
VERSION 4.11.1
LANGUAGES Fortran C)

cmake_policy(SET CMP0077 NEW)
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.11.1] - 2025-02-04

### Fixed

- Workaround for gfortran 13/14 on Ubuntu. Failure does not show on other flavors of Linux no macos.

## [4.11.0] - 2025-02-03

### Changed
Expand Down
47 changes: 29 additions & 18 deletions src/funit/fhamcrest/Every.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,35 @@ recursive subroutine describe_first_mismatch(this, actuals, description, index)
class(MatcherDescription), intent(inout) :: description
integer, allocatable, intent(inout) :: index(:)

integer :: i

class(*), allocatable :: item
do i = 1, size(actuals)
item = actuals(i)
if (.not. this%matches(item)) then
select type (item)
class is (AbstractArrayWrapper)
call this%describe_first_mismatch(item%get(), description, index)
index = [index, i]
class default ! scalar
call this%item_matcher%describe_mismatch(actuals(i), description)
index = [i]
end select
return
end if
end do

call describe_with_target(this, actuals, description, index)

contains

subroutine describe_with_target(this, actuals, description, index)
class(Every), intent(in) :: this
class(*), target, intent(in) :: actuals(:)
class(MatcherDescription), intent(inout) :: description
integer, allocatable, intent(inout) :: index(:)

integer :: i

class(*), pointer :: item

do i = 1, size(actuals)
item => actuals(i)
if (.not. this%matches(item)) then
select type (item)
class is (AbstractArrayWrapper)
call this%describe_first_mismatch(item%get(), description, index)
index = [index, i]
class default ! scalar
call this%item_matcher%describe_mismatch(actuals(i), description)
index = [i]
end select
return
end if
end do
end subroutine describe_with_target
end subroutine describe_first_mismatch

subroutine describe_to(this, description)
Expand Down

0 comments on commit cbe21b9

Please sign in to comment.