From ade822905b39570cc178613e5ab828c3cc8e7107 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 8 Mar 2024 12:03:38 -0500 Subject: [PATCH 01/12] Add quiet flag for NAG Fortran This PR adds `-quiet` to the NAG Fortran compiler flags. This flag will "[s]uppress the compiler banner and the summary line, so that only diagnostic messages will appear." --- ChangeLog.md | 4 ++++ cmake/NAG.cmake | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7508fd55..767206ec 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Added `-quiet` flag for NAG Fortran + ## [4.9.0] - 2024-02-06 ### Added diff --git a/cmake/NAG.cmake b/cmake/NAG.cmake index e7835fd9..b382d71c 100644 --- a/cmake/NAG.cmake +++ b/cmake/NAG.cmake @@ -7,7 +7,7 @@ set(check_all "-C=pointer") set(cpp "-fpp") set(mismatch "-mismatch") -set(common_flags "${cpp} -w=x95") +set(common_flags "${cpp} -w=x95 -quiet") set(CMAKE_Fortran_FLAGS_DEBUG "${common_flags} -O0 ${check_all} ${traceback}") set(CMAKE_Fortran_FLAGS_RELEASE ${common_flags}) From 59a69f19e04103599b3784f00656ac4eb0c7d554 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 20 Mar 2024 08:02:31 -0400 Subject: [PATCH 02/12] CI: Remove macos-11, add macos-13 As `macos-11` is deprecated at GitHub Actions (and is ancient) we remove it and add `macos-13` --- .github/workflows/main.yml | 6 +++--- ChangeLog.md | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 81b92eaf..b1396e20 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,13 +18,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-11, macos-12] + os: [ubuntu-22.04, macos-12, macos-13] compiler: [gfortran-10, gfortran-11, gfortran-12, gfortran-13] exclude: - - os: macos-11 - compiler: gfortran-13 - os: macos-12 compiler: gfortran-10 + - os: macos-13 + compiler: gfortran-10 # fail-fast if set to 'true' here is good for production, but when # debugging, set to 'false'. fail-fast means if *any* ci test in the matrix fails diff --git a/ChangeLog.md b/ChangeLog.md index 767206ec..c5dd396c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Added `-quiet` flag for NAG Fortran +- Remove `macos-11` from GitHub Actions, add `macos-12` ## [4.9.0] - 2024-02-06 From 202475e567a5a71d8e455ce9e947d825ab94b449 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 20 Mar 2024 09:20:26 -0400 Subject: [PATCH 03/12] Update to Open MPI 5.0.2 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b1396e20..1b3460d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,7 @@ jobs: - name: Build MPI if: steps.cache-mpi.outputs.cache-hit != 'true' run: | - sh ${GITHUB_WORKSPACE}/tools/ci-install-mpi.sh openmpi 4.1.4 + sh ${GITHUB_WORKSPACE}/tools/ci-install-mpi.sh openmpi 5.0.2 - name: Set MPI Environment run: | From c402d921210e4ad4f60b174738d539987d1e0614 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 7 May 2024 11:27:17 -0400 Subject: [PATCH 04/12] Preliminary LLVMFlang Support This PR adds preliminary support for the `LLVMFlang` compiler. At the moment, there are still issues with testing, etc. --- ChangeLog.md | 4 ++++ cmake/LLVMFlang.cmake | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 cmake/LLVMFlang.cmake diff --git a/ChangeLog.md b/ChangeLog.md index 767206ec..c10be89f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `-quiet` flag for NAG Fortran +### Added + +- LLVMFlang compiler support + ## [4.9.0] - 2024-02-06 ### Added diff --git a/cmake/LLVMFlang.cmake b/cmake/LLVMFlang.cmake new file mode 100644 index 00000000..471c421a --- /dev/null +++ b/cmake/LLVMFlang.cmake @@ -0,0 +1,7 @@ +# Compiler specific flags for LLVM Flang + +set(cpp "-cpp") + +set(common_flags "${cpp}") +set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g ${common_flags}") +set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${common_flags}") From a29cbfd809313d9edb33f9b71747e020ebb3f4eb Mon Sep 17 00:00:00 2001 From: Charles Ferenbaugh Date: Mon, 20 May 2024 11:57:10 -0700 Subject: [PATCH 05/12] Update pFUnit to use v2 template interfaces --- ChangeLog.md | 1 + extern/fArgParse | 2 +- src/funit/CMakeLists.txt | 6 +++--- src/funit/core/AbstractPattern.F90 | 10 +++++----- src/funit/core/ExceptionList.F90 | 7 ++++--- src/funit/core/ExceptionVector.F90 | 10 +++++----- src/funit/core/TestAnnotation.F90 | 15 +++++++------- src/funit/core/TestFailureVector.F90 | 13 ++++++++---- src/funit/core/TestListenerVector.F90 | 10 +++++----- src/funit/core/TestSuite.F90 | 2 +- src/funit/core/TestVector.F90 | 10 +++++----- src/funit/fhamcrest/AllOf.F90 | 4 ++-- src/funit/fhamcrest/AnyOf.F90 | 4 ++-- src/funit/fhamcrest/BaseDescription.F90 | 2 +- src/funit/fhamcrest/MatcherVector.F90 | 21 ++++++++++---------- src/funit/fhamcrest/SelfDescribingVector.F90 | 20 +++++++++---------- 16 files changed, 72 insertions(+), 65 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index c10be89f..e283ae3a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Updated pFUnit to use v2 template interfaces - Added `-quiet` flag for NAG Fortran ### Added diff --git a/extern/fArgParse b/extern/fArgParse index 82442c77..4d40653b 160000 --- a/extern/fArgParse +++ b/extern/fArgParse @@ -1 +1 @@ -Subproject commit 82442c77a9a4f19fa3777aeb5c54bac4b8dac2fa +Subproject commit 4d40653bd0e6ac0e3547e4840fe3ad2147b15921 diff --git a/src/funit/CMakeLists.txt b/src/funit/CMakeLists.txt index cecc0746..d6878873 100644 --- a/src/funit/CMakeLists.txt +++ b/src/funit/CMakeLists.txt @@ -22,15 +22,15 @@ function(funit_target_link_pfunit funit_target) target_link_libraries (${funit_target} PUBLIC OpenMP::OpenMP_Fortran) endif () - if (NOT TARGET GFTL::gftl) + if (NOT TARGET GFTL::gftl-v2) message(FATAL_ERROR "Could not find gFTL. This should not happen.") endif () - if (NOT TARGET GFTL_SHARED::gftl-shared) + if (NOT TARGET GFTL_SHARED::gftl-shared-v2) message(FATAL_ERROR "Could not find gFTL-shared. This should not happen.") endif () - target_link_libraries (${funit_target} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared FARGPARSE::fargparse) + target_link_libraries (${funit_target} PUBLIC GFTL::gftl-v2 GFTL_SHARED::gftl-shared-v2 GFTL_SHARED::gftl-shared-v2-as-default FARGPARSE::fargparse) target_include_directories(${funit_target} PUBLIC $ ) diff --git a/src/funit/core/AbstractPattern.F90 b/src/funit/core/AbstractPattern.F90 index a0945ec2..25a5eeb3 100644 --- a/src/funit/core/AbstractPattern.F90 +++ b/src/funit/core/AbstractPattern.F90 @@ -25,11 +25,11 @@ end module PF_AbstractPattern module PF_AbstractPatternVector use PF_AbstractPattern -#define _type class (AbstractPattern) -#define _allocatable -#define _vector AbstractPatternVector -#define _iterator AbstractPatternVectorIterator +#define T AbstractPattern +#define T_polymorphic +#define Vector AbstractPatternVector +#define VectorIterator AbstractPatternVectorIterator -#include "templates/vector.inc" +#include "vector/template.inc" end module PF_AbstractPatternVector diff --git a/src/funit/core/ExceptionList.F90 b/src/funit/core/ExceptionList.F90 index 952b1ca2..6ecd30d5 100644 --- a/src/funit/core/ExceptionList.F90 +++ b/src/funit/core/ExceptionList.F90 @@ -102,10 +102,10 @@ logical function catch_message(this, message, preserve) result(found) iter = this%begin() do while (iter /= this%end()) - e => iter%get() + e => iter%of() if (e%getMessage() == message) then found = .true. - if (.not. preserveMessage(preserve)) call this%erase(iter) + if (.not. preserveMessage(preserve)) iter = this%erase(iter) return end if call iter%next() @@ -119,6 +119,7 @@ function catch_next(this, preserve) result(anException) class (ExceptionList), intent(inOut) :: this logical, optional, intent(in) :: preserve type (Exception) :: anException + type (ExceptionVectorIterator) :: iter if (.not. this%empty()) then @@ -134,7 +135,7 @@ function catch_next(this, preserve) result(anException) #endif if (preserveMessage(preserve)) return - call this%erase(this%begin()) + iter = this%erase(this%begin()) end if end function catch_next diff --git a/src/funit/core/ExceptionVector.F90 b/src/funit/core/ExceptionVector.F90 index 35753d2b..45ef67df 100644 --- a/src/funit/core/ExceptionVector.F90 +++ b/src/funit/core/ExceptionVector.F90 @@ -1,10 +1,10 @@ module PF_ExceptionVector use PF_Exception -#define _type class(Exception) -#define _allocatable -#define _vector ExceptionVector -#define _iterator ExceptionVectorIterator -#include "templates/vector.inc" +#define T Exception +#define T_polymorphic +#define Vector ExceptionVector +#define VectorIterator ExceptionVectorIterator +#include "vector/template.inc" end module PF_ExceptionVector diff --git a/src/funit/core/TestAnnotation.F90 b/src/funit/core/TestAnnotation.F90 index 399fa4a7..a5f90918 100644 --- a/src/funit/core/TestAnnotation.F90 +++ b/src/funit/core/TestAnnotation.F90 @@ -24,13 +24,12 @@ end module pf_TestAnnotation module pf_StringTestAnnotationMap use pf_TestAnnotation -#define _map StringTestAnnotationMap -#define _iterator StringTestAnnotationMapIterator -#define _pair StringTestAnnotationPair -#include "types/key_deferredLengthString.inc" -#define _value_allocatable -#define _value class(TestAnnotation) -#define _alt -#include "templates/map.inc" +#define Map StringTestAnnotationMap +#define MapIterator StringTestAnnotationMapIterator +#define Pair StringTestAnnotationPair +#define Key __CHARACTER_DEFERRED +#define T TestAnnotation +#define T_polymorphic +#include "map/template.inc" end module pf_StringTestAnnotationMap diff --git a/src/funit/core/TestFailureVector.F90 b/src/funit/core/TestFailureVector.F90 index 804d8d46..1f23037c 100644 --- a/src/funit/core/TestFailureVector.F90 +++ b/src/funit/core/TestFailureVector.F90 @@ -1,8 +1,13 @@ module PF_TestFailureVector use PF_TestFailure -#define _type type (TestFailure) -#define _vector TestFailureVector -#define _iterator TestFailureVectorIterator -#include "templates/vector.inc" +!#define _type type (TestFailure) +!#define _vector TestFailureVector +!#define _iterator TestFailureVectorIterator +!#include "templates/vector.inc" + +#define T TestFailure +#define Vector TestFailureVector +#define VectorIterator TestFailureVectorIterator +#include "vector/template.inc" end module PF_TestFailureVector diff --git a/src/funit/core/TestListenerVector.F90 b/src/funit/core/TestListenerVector.F90 index 88e3b63a..d9cb602b 100644 --- a/src/funit/core/TestListenerVector.F90 +++ b/src/funit/core/TestListenerVector.F90 @@ -1,9 +1,9 @@ module PF_TestListenerVector use PF_TestListener -#define _type class (TestListener) -#define _allocatable -#define _vector TestListenerVector -#define _iterator TestListenerVectorIterator -#include "templates/vector.inc" +#define T TestListener +#define T_polymorphic +#define Vector TestListenerVector +#define VectorIterator TestListenerVectorIterator +#include "vector/template.inc" end module PF_TestListenerVector diff --git a/src/funit/core/TestSuite.F90 b/src/funit/core/TestSuite.F90 index 1660bf56..9e956aed 100644 --- a/src/funit/core/TestSuite.F90 +++ b/src/funit/core/TestSuite.F90 @@ -189,7 +189,7 @@ recursive function filter(this, a_filter) result(new_suite) iter = this%tests%begin() do while (iter /= this%tests%end()) - t => iter%get() + t => iter%of() select type (t) class is (TestSuite) diff --git a/src/funit/core/TestVector.F90 b/src/funit/core/TestVector.F90 index 900ad648..a569a6ee 100644 --- a/src/funit/core/TestVector.F90 +++ b/src/funit/core/TestVector.F90 @@ -1,9 +1,9 @@ module PF_TestVector use PF_Test -#define _type class (Test) -#define _allocatable -#define _vector TestVector -#define _iterator TestVectorIterator -#include "templates/vector.inc" +#define T Test +#define T_polymorphic +#define Vector TestVector +#define VectorIterator TestVectorIterator +#include "vector/template.inc" end module PF_TestVector diff --git a/src/funit/fhamcrest/AllOf.F90 b/src/funit/fhamcrest/AllOf.F90 index 4ef2e067..760b3969 100644 --- a/src/funit/fhamcrest/AllOf.F90 +++ b/src/funit/fhamcrest/AllOf.F90 @@ -89,7 +89,7 @@ logical function matches(this, actual_value) iter = this%matchers%begin() do while (iter /= this%matchers%end()) - matcher => iter%get() + matcher => iter%of() if (.not. matcher%matches(actual_value)) then matches = .false. return @@ -120,7 +120,7 @@ subroutine describe_to_op(this, description, operator) allocate(matchers_as_SelfDescribing) ! ensure empty at each iteration iter = this%matchers%begin() do while (iter /= this%matchers%end()) - call matchers_as_SelfDescribing%push_back(iter%get()) + call matchers_as_SelfDescribing%push_back(iter%of()) call iter%next() end do diff --git a/src/funit/fhamcrest/AnyOf.F90 b/src/funit/fhamcrest/AnyOf.F90 index 52fbb36c..0b2b5ddb 100644 --- a/src/funit/fhamcrest/AnyOf.F90 +++ b/src/funit/fhamcrest/AnyOf.F90 @@ -93,7 +93,7 @@ logical function matches(this, actual_value) iter = this%matchers%begin() do while (iter /= this%matchers%end()) - matcher => iter%get() + matcher => iter%of() if (matcher%matches(actual_value)) then matches = .true. return @@ -125,7 +125,7 @@ subroutine describe_to_op(this, description, operator) allocate(matchers_as_SelfDescribing) ! ensure empty at each iteration iter = this%matchers%begin() do while (iter /= this%matchers%end()) - call matchers_as_SelfDescribing%push_back(iter%get()) + call matchers_as_SelfDescribing%push_back(iter%of()) call iter%next() end do diff --git a/src/funit/fhamcrest/BaseDescription.F90 b/src/funit/fhamcrest/BaseDescription.F90 index acc72857..bcf5b8e4 100644 --- a/src/funit/fhamcrest/BaseDescription.F90 +++ b/src/funit/fhamcrest/BaseDescription.F90 @@ -246,7 +246,7 @@ subroutine append_list_vector(this, start, separator, end, values) iter = values%begin() do while (iter /= values%end()) if (separate) call this%append(separator) - call this%append_description_of(iter%get()) + call this%append_description_of(iter%of()) separate = .true. call iter%next() end do diff --git a/src/funit/fhamcrest/MatcherVector.F90 b/src/funit/fhamcrest/MatcherVector.F90 index b5da84ed..999ab6f7 100644 --- a/src/funit/fhamcrest/MatcherVector.F90 +++ b/src/funit/fhamcrest/MatcherVector.F90 @@ -1,16 +1,17 @@ module pf_MatcherVector use pf_AbstractMatcher -#define _type class(AbstractMatcher) -#define _vector MatcherVector -#define _vectorIterator MatcherVectorIterator -#define _allocatable +#define T AbstractMatcher +#define T_polymorphic +#define Vector MatcherVector +#define VectorIterator MatcherVectorIterator + +#include "vector/template.inc" + +#undef VectorIterator +#undef Vector +#undef T_polymorphic +#undef T -#include "templates/vector.inc" -#undef _allocatable -#undef _vectorIterator -#undef _vector -#undef _type - end module pf_MatcherVector diff --git a/src/funit/fhamcrest/SelfDescribingVector.F90 b/src/funit/fhamcrest/SelfDescribingVector.F90 index 7ffaa339..ae961aeb 100644 --- a/src/funit/fhamcrest/SelfDescribingVector.F90 +++ b/src/funit/fhamcrest/SelfDescribingVector.F90 @@ -1,16 +1,16 @@ module pf_SelfDescribingVector use pf_SelfDescribing -#define _type class(SelfDescribing) -#define _vector SelfDescribingVector -#define _vectorIterator SelfDescribingVectorIterator -#define _allocatable +#define T SelfDescribing +#define T_polymorphic +#define Vector SelfDescribingVector +#define VectorIterator SelfDescribingVectorIterator -#include "templates/vector.inc" +#include "vector/template.inc" + +#undef VectorIterator +#undef Vector +#undef T_polymorphic +#undef T -#undef _allocatable -#undef _vectorIterator -#undef _vector -#undef _type - end module pf_SelfDescribingVector From a0aa483fa2c0a122c2ec6cadf1cc80cbc0de7b7c Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 20 May 2024 16:07:51 -0400 Subject: [PATCH 06/12] Fix up CI --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b3460d1..8afc7634 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,13 +18,19 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-12, macos-13] + os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14] compiler: [gfortran-10, gfortran-11, gfortran-12, gfortran-13] exclude: - - os: macos-12 - compiler: gfortran-10 - os: macos-13 compiler: gfortran-10 + - os: macos-14 + compiler: gfortran-10 + - os: ubuntu-24.04 + compiler: gfortran-10 + - os: ubuntu-24.04 + compiler: gfortran-11 + - os: ubuntu-22.04 + compiler: gfortran-13 # fail-fast if set to 'true' here is good for production, but when # debugging, set to 'false'. fail-fast means if *any* ci test in the matrix fails From 2f5345d1b93cecf2d2aa804dd7ade6bcbd58f366 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 21 May 2024 09:11:06 -0400 Subject: [PATCH 07/12] Try 4 processors --- .github/workflows/main.yml | 4 ++-- tools/ci-install-mpi.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8afc7634..392600ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,10 +93,10 @@ jobs: run: cmake -B build - name: Build pfUnit - run: cmake --build build --parallel + run: cmake --build build --parallel 4 - name: Build Tests - run: cmake --build build --parallel -t build-tests + run: cmake --build build --parallel 4 -t build-tests - name: Run Tests run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 --schedule-random diff --git a/tools/ci-install-mpi.sh b/tools/ci-install-mpi.sh index b0ac2434..0bb669bc 100644 --- a/tools/ci-install-mpi.sh +++ b/tools/ci-install-mpi.sh @@ -15,7 +15,7 @@ then tar xjf ${MPI_IMPL}-${MPI_VER}.tar.bz2 && rm ${MPI_IMPL}-${MPI_VER}.tar.bz2 cd ${MPI_IMPL}-${MPI_VER} ./configure --prefix=${HOME}/local/${MPI_IMPL} --disable-wrapper-rpath --disable-wrapper-runpath --with-hwloc=internal --with-libevent=internal - make -j $(nproc) + make -j 4 make install-strip cd .. && rm -r ${MPI_IMPL}-${MPI_VER} exit 0 From 4a8733c8fa8c12f659fdf09ea4bea1e8b50227c3 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 18 Jun 2024 10:31:00 -0400 Subject: [PATCH 08/12] Add gfortran-14 --- .github/workflows/main.yml | 13 +++++++------ ChangeLog.md | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 392600ce..f0a8cb51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,14 +19,15 @@ jobs: strategy: matrix: os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14] - compiler: [gfortran-10, gfortran-11, gfortran-12, gfortran-13] - exclude: - - os: macos-13 - compiler: gfortran-10 - - os: macos-14 + compiler: [gfortran-11, gfortran-12, gfortran-13] + # gfortran-10 is only on ubuntu-22.04 + # gfortran-14 is available on ubuntu-24.04 + include: + - os: ubuntu-22.04 compiler: gfortran-10 - os: ubuntu-24.04 - compiler: gfortran-10 + compiler: gfortran-14 + exclude: - os: ubuntu-24.04 compiler: gfortran-11 - os: ubuntu-22.04 diff --git a/ChangeLog.md b/ChangeLog.md index 0e80b03c..6d82b389 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Added `-quiet` flag for NAG Fortran -- Remove `macos-11` from GitHub Actions, add `macos-12` +- Remove `macos-11` from GitHub Actions, add `macos-12` and `gfortran-14` to Ubuntu 24.04 ### Added From b652e9c3c6d559cda55ef4dd040f330961b69714 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 8 Jul 2024 15:50:27 -0400 Subject: [PATCH 09/12] Fix up some ctest errors --- .github/workflows/main.yml | 26 ++++++++++++------- ChangeLog.md | 4 +++ bin/tests/inputs/MpiParameterizedTestCaseC.pf | 4 +-- bin/tests/inputs/MpiTestCaseB.pf | 4 +-- bin/tests/inputs/ParameterizedTestCaseB.pf | 4 +-- bin/tests/inputs/TestA.pf | 4 +-- bin/tests/inputs/TestCaseA.pf | 4 +-- 7 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0a8cb51..8b837d6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,10 +97,12 @@ jobs: run: cmake --build build --parallel 4 - name: Build Tests - run: cmake --build build --parallel 4 -t build-tests + run: | + cmake --build build --parallel 4 --target build-tests + cmake --build build --parallel 4 --target tests - - name: Run Tests - run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 --schedule-random + - name: Run Ctest + run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 - name: Archive log files on failure uses: actions/upload-artifact@v4 @@ -111,7 +113,7 @@ jobs: build/**/*.log Intel: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: FC: ifx @@ -164,10 +166,12 @@ jobs: run: cmake --build build --parallel - name: Build Tests - run: cmake --build build --parallel -t build-tests + run: | + cmake --build build --parallel 4 --target build-tests + cmake --build build --parallel 4 --target tests - - name: Run Tests - run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 --schedule-random + - name: Run Ctest + run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 - name: Archive log files on failure uses: actions/upload-artifact@v4 @@ -211,10 +215,12 @@ jobs: run: cmake --build build --parallel - name: Build Tests - run: cmake --build build --parallel -t build-tests + run: | + cmake --build build --parallel 4 --target build-tests + cmake --build build --parallel 4 --target tests - - name: Run Tests - run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 --schedule-random + - name: Run Ctest + run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 - name: Archive log files on failure uses: actions/upload-artifact@v4 diff --git a/ChangeLog.md b/ChangeLog.md index 6d82b389..23e4fd50 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - LLVMFlang compiler support +### Fixed + +- Fixes some ctest failures + ## [4.9.0] - 2024-02-06 ### Added diff --git a/bin/tests/inputs/MpiParameterizedTestCaseC.pf b/bin/tests/inputs/MpiParameterizedTestCaseC.pf index a22180b5..3e046fd5 100644 --- a/bin/tests/inputs/MpiParameterizedTestCaseC.pf +++ b/bin/tests/inputs/MpiParameterizedTestCaseC.pf @@ -1,4 +1,4 @@ -module TestCaseC_mod +module MpiParameterizedTestCaseC use pfunit_mod implicit none @@ -117,6 +117,6 @@ contains end function toString -end module TestCaseC_mod +end module MpiParameterizedTestCaseC diff --git a/bin/tests/inputs/MpiTestCaseB.pf b/bin/tests/inputs/MpiTestCaseB.pf index daf82893..907937a1 100644 --- a/bin/tests/inputs/MpiTestCaseB.pf +++ b/bin/tests/inputs/MpiTestCaseB.pf @@ -1,4 +1,4 @@ -module MpiTestCaseB_mod +module MpiTestCaseB use pfunit_mod implicit none @@ -35,6 +35,6 @@ contains class (MpiTestCaseB), intent(inout) :: this end subroutine testB -end module MpiTestCaseB_mod +end module MpiTestCaseB diff --git a/bin/tests/inputs/ParameterizedTestCaseB.pf b/bin/tests/inputs/ParameterizedTestCaseB.pf index ddd64585..8c894cc0 100644 --- a/bin/tests/inputs/ParameterizedTestCaseB.pf +++ b/bin/tests/inputs/ParameterizedTestCaseB.pf @@ -1,4 +1,4 @@ -module TestCaseB_mod +module ParameterizedTestCaseB use pfunit_mod implicit none @@ -64,6 +64,6 @@ contains end function toString -end module TestCaseB_mod +end module ParameterizedTestCaseB diff --git a/bin/tests/inputs/TestA.pf b/bin/tests/inputs/TestA.pf index ee0ce16d..eece1473 100644 --- a/bin/tests/inputs/TestA.pf +++ b/bin/tests/inputs/TestA.pf @@ -1,4 +1,4 @@ -module TestA_mod +module TestA use pfunit_mod implicit none @@ -19,6 +19,6 @@ contains class (MpiTestMethod), intent(inout) :: this end subroutine testMethodC -end module TestA_mod +end module TestA diff --git a/bin/tests/inputs/TestCaseA.pf b/bin/tests/inputs/TestCaseA.pf index fa9bb5da..7205c978 100644 --- a/bin/tests/inputs/TestCaseA.pf +++ b/bin/tests/inputs/TestCaseA.pf @@ -1,4 +1,4 @@ -module TestCaseA_mod +module TestCaseA use pfunit_mod implicit none @@ -35,4 +35,4 @@ contains class (TestCaseA), intent(inout) :: this end subroutine testB -end module TestCaseA_mod +end module TestCaseA From c2a7c057329ceaf6fc2957ad935222a44b2b7eed Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 8 Jul 2024 16:58:21 -0400 Subject: [PATCH 10/12] Fix up ctest --- .gitignore | 3 ++- CMakeLists.txt | 43 +++++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 58a7f4e6..44148945 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ /mpi_pFUnit.x /nag *.zip -build/ \ No newline at end of file +build/ +Testing/ diff --git a/CMakeLists.txt b/CMakeLists.txt index b342c312..1bb09395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,12 @@ if (APPLE) SET(CMAKE_Fortran_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") endif () +# Enable testing before adding subdirectories +# to catch any tests in the main project +if (ENABLE_TESTS) + enable_testing() +endif () + include(build_submodule) # Find fArgParse first so that gFTL and gFTL-shared are consistent build_submodule(extern/fArgParse PROJECT FARGPARSE TARGET FARGPARSE::fargparse) @@ -150,28 +156,25 @@ if (ENABLE_BUILD_DOXYGEN) add_subdirectory(documentation) endif() -if (ENABLE_TESTS) - enable_testing() - if (NOT TARGET build-tests) - add_custom_target(build-tests) - endif() - - if (NOT TARGET tests) - add_custom_target(tests - COMMAND ${CMAKE_CTEST_COMMAND} - EXCLUDE_FROM_ALL) - endif () - add_dependencies(tests build-tests) - add_subdirectory (tests EXCLUDE_FROM_ALL) - - # The following forces tests to be built when using "make ctest" even if some targets - # are EXCLUDE_FROM_ALL - # From https://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests/56448477#56448477 - build_command(CTEST_CUSTOM_PRE_TEST TARGET build-tests) - string(CONFIGURE \"@CTEST_CUSTOM_PRE_TEST@\" CTEST_CUSTOM_PRE_TEST_QUOTED ESCAPE_QUOTES) - file(WRITE "${CMAKE_BINARY_DIR}/CTestCustom.cmake" "set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST_QUOTED})" "\n") +if (NOT TARGET build-tests) + add_custom_target(build-tests) endif() +if (NOT TARGET tests) + add_custom_target(tests + COMMAND ${CMAKE_CTEST_COMMAND} + EXCLUDE_FROM_ALL) +endif () +add_dependencies(tests build-tests) +add_subdirectory (tests EXCLUDE_FROM_ALL) + +# The following forces tests to be built when using "make ctest" even if some targets +# are EXCLUDE_FROM_ALL +# From https://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests/56448477#56448477 +build_command(CTEST_CUSTOM_PRE_TEST TARGET build-tests) +string(CONFIGURE \"@CTEST_CUSTOM_PRE_TEST@\" CTEST_CUSTOM_PRE_TEST_QUOTED ESCAPE_QUOTES) +file(WRITE "${CMAKE_BINARY_DIR}/CTestCustom.cmake" "set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST_QUOTED})" "\n") + # The following is needed for external projects using *nix make when # parent project builds pFUnit as a subproject. set (top_dir PFUNIT-${PFUNIT_VERSION_MAJOR}.${PFUNIT_VERSION_MINOR}) From 5713a08dd4fc2445ee9d8f1afd64c5085a821653 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Tue, 9 Jul 2024 14:09:55 -0400 Subject: [PATCH 11/12] Updated submodule to CI can work. --- ChangeLog.md | 1 + extern/fArgParse | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 04d075ca..0a72fc0f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated pFUnit to use v2 template interfaces - Added `-quiet` flag for NAG Fortran - Remove `macos-11` from GitHub Actions, add `macos-12` and `gfortran-14` to Ubuntu 24.04 +- Updated fArgParse to v1.8.0 ### Added diff --git a/extern/fArgParse b/extern/fArgParse index 4d40653b..fd52a2e2 160000 --- a/extern/fArgParse +++ b/extern/fArgParse @@ -1 +1 @@ -Subproject commit 4d40653bd0e6ac0e3547e4840fe3ad2147b15921 +Subproject commit fd52a2e229b415701372b8ced99eb8162af1c404 From b084d09eba7850dd7e32da8e74626e7691cea65f Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Wed, 10 Jul 2024 09:20:35 -0400 Subject: [PATCH 12/12] Prep for release --- CMakeLists.txt | 4 ++-- ChangeLog.md | 2 ++ cmake/build_submodule.cmake | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bb09395..c06eb15c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ cmake_minimum_required(VERSION 3.12) project (PFUNIT - VERSION 4.9.0 + VERSION 4.10.0 LANGUAGES Fortran C) cmake_policy(SET CMP0077 NEW) @@ -146,7 +146,7 @@ endif () include(build_submodule) # Find fArgParse first so that gFTL and gFTL-shared are consistent -build_submodule(extern/fArgParse PROJECT FARGPARSE TARGET FARGPARSE::fargparse) +build_submodule(extern/fArgParse PROJECT FARGPARSE TARGET FARGPARSE::fargparse VERSION 1.8.0) add_subdirectory (src) add_subdirectory (include) diff --git a/ChangeLog.md b/ChangeLog.md index 88f336e0..f5ce3a20 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -5,6 +5,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [4.10.0] - 2024-07-10 + ### Changed - Updated pFUnit to use v2 template interfaces diff --git a/cmake/build_submodule.cmake b/cmake/build_submodule.cmake index 5f46be35..2ac65bea 100644 --- a/cmake/build_submodule.cmake +++ b/cmake/build_submodule.cmake @@ -3,11 +3,11 @@ macro (build_submodule submodule) set(options) - set(oneValueArgs TARGET PROJECT) + set(oneValueArgs TARGET PROJECT VERSION) set(multiValueArgs) cmake_parse_arguments(build_submodule "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - find_package(${build_submodule_PROJECT} QUIET) + find_package(${build_submodule_PROJECT} ${build_submodule_VERSION} QUIET) if (${build_submodule_PROJECT}_FOUND) message(STATUS "Using package '${build_submodule_PROJECT}'")