From c9274cdc8b89011ca6078d8c5a77349a52fd3cbe Mon Sep 17 00:00:00 2001 From: "Thomas L. Clune" Date: Wed, 5 Feb 2025 08:15:40 -0500 Subject: [PATCH 1/3] Workaround for gfortran --- CMakeLists.txt | 2 +- ChangeLog.md | 6 +++++ src/funit/fhamcrest/Every.F90 | 47 +++++++++++++++++++++-------------- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cd10474..723d1525 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.10 LANGUAGES Fortran C) cmake_policy(SET CMP0077 NEW) diff --git a/ChangeLog.md b/ChangeLog.md index d6b94630..f20f293e 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.0] - 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) From 646ce4c0d6a7099f06d4cd3373f6fd17cc3b2cd3 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Wed, 5 Feb 2025 08:26:44 -0500 Subject: [PATCH 2/3] Update CMakeLists.txt Co-authored-by: Matt Thompson --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 723d1525..b8339246 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ cmake_minimum_required(VERSION 3.12) project (PFUNIT - VERSION 4.11.10 + VERSION 4.11.1 LANGUAGES Fortran C) cmake_policy(SET CMP0077 NEW) From ce9bbe2555e265466aca0939f22c34243387ec61 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Wed, 5 Feb 2025 08:26:56 -0500 Subject: [PATCH 3/3] Update ChangeLog.md Co-authored-by: Matt Thompson --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index f20f293e..5110ffe6 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -5,7 +5,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [4.11.0] - 2025-02-04 +## [4.11.1] - 2025-02-04 ### Fixed