diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cd10474..b8339246 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/ChangeLog.md b/ChangeLog.md index d6b94630..5110ffe6 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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 diff --git a/src/funit/fhamcrest/Every.F90 b/src/funit/fhamcrest/Every.F90 index 4bf263df..4b1ade93 100644 --- a/src/funit/fhamcrest/Every.F90 +++ b/src/funit/fhamcrest/Every.F90 @@ -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)