Skip to content

Commit 26dadb1

Browse files
authored
Merge pull request #473 from Goddard-Fortran-Ecosystem/develop
Develop
2 parents decc27e + 39990ca commit 26dadb1

28 files changed

+166
-119
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
matrix:
21-
os: [ubuntu-22.04, macos-11, macos-12]
22-
compiler: [gfortran-10, gfortran-11, gfortran-12, gfortran-13]
21+
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
22+
compiler: [gfortran-11, gfortran-12, gfortran-13]
23+
# gfortran-10 is only on ubuntu-22.04
24+
# gfortran-14 is available on ubuntu-24.04
25+
include:
26+
- os: ubuntu-22.04
27+
compiler: gfortran-10
28+
- os: ubuntu-24.04
29+
compiler: gfortran-14
2330
exclude:
24-
- os: macos-11
31+
- os: ubuntu-24.04
32+
compiler: gfortran-11
33+
- os: ubuntu-22.04
2534
compiler: gfortran-13
26-
- os: macos-12
27-
compiler: gfortran-10
2835

2936
# fail-fast if set to 'true' here is good for production, but when
3037
# debugging, set to 'false'. fail-fast means if *any* ci test in the matrix fails
@@ -69,7 +76,7 @@ jobs:
6976
- name: Build MPI
7077
if: steps.cache-mpi.outputs.cache-hit != 'true'
7178
run: |
72-
sh ${GITHUB_WORKSPACE}/tools/ci-install-mpi.sh openmpi 4.1.4
79+
sh ${GITHUB_WORKSPACE}/tools/ci-install-mpi.sh openmpi 5.0.2
7380
7481
- name: Set MPI Environment
7582
run: |
@@ -87,13 +94,15 @@ jobs:
8794
run: cmake -B build
8895

8996
- name: Build pfUnit
90-
run: cmake --build build --parallel
97+
run: cmake --build build --parallel 4
9198

9299
- name: Build Tests
93-
run: cmake --build build --parallel -t build-tests
100+
run: |
101+
cmake --build build --parallel 4 --target build-tests
102+
cmake --build build --parallel 4 --target tests
94103
95-
- name: Run Tests
96-
run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 --schedule-random
104+
- name: Run Ctest
105+
run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4
97106

98107
- name: Archive log files on failure
99108
uses: actions/upload-artifact@v4
@@ -104,7 +113,7 @@ jobs:
104113
build/**/*.log
105114
106115
Intel:
107-
runs-on: ubuntu-20.04
116+
runs-on: ubuntu-latest
108117

109118
env:
110119
FC: ifx
@@ -157,10 +166,12 @@ jobs:
157166
run: cmake --build build --parallel
158167

159168
- name: Build Tests
160-
run: cmake --build build --parallel -t build-tests
169+
run: |
170+
cmake --build build --parallel 4 --target build-tests
171+
cmake --build build --parallel 4 --target tests
161172
162-
- name: Run Tests
163-
run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 --schedule-random
173+
- name: Run Ctest
174+
run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4
164175

165176
- name: Archive log files on failure
166177
uses: actions/upload-artifact@v4
@@ -204,10 +215,12 @@ jobs:
204215
run: cmake --build build --parallel
205216

206217
- name: Build Tests
207-
run: cmake --build build --parallel -t build-tests
218+
run: |
219+
cmake --build build --parallel 4 --target build-tests
220+
cmake --build build --parallel 4 --target tests
208221
209-
- name: Run Tests
210-
run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4 --schedule-random
222+
- name: Run Ctest
223+
run: ctest --test-dir build --parallel 1 --output-on-failure --repeat until-pass:4
211224

212225
- name: Archive log files on failure
213226
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
/mpi_pFUnit.x
1616
/nag
1717
*.zip
18-
build/
18+
build/
19+
Testing/

CMakeLists.txt

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
cmake_minimum_required(VERSION 3.12)
2626

2727
project (PFUNIT
28-
VERSION 4.9.0
28+
VERSION 4.10.0
2929
LANGUAGES Fortran C)
3030

3131
cmake_policy(SET CMP0077 NEW)
@@ -138,9 +138,15 @@ if (APPLE)
138138
SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
139139
endif ()
140140

141+
# Enable testing before adding subdirectories
142+
# to catch any tests in the main project
143+
if (ENABLE_TESTS)
144+
enable_testing()
145+
endif ()
146+
141147
include(build_submodule)
142148
# Find fArgParse first so that gFTL and gFTL-shared are consistent
143-
build_submodule(extern/fArgParse PROJECT FARGPARSE TARGET FARGPARSE::fargparse)
149+
build_submodule(extern/fArgParse PROJECT FARGPARSE TARGET FARGPARSE::fargparse VERSION 1.8.0)
144150

145151
add_subdirectory (src)
146152
add_subdirectory (include)
@@ -150,28 +156,25 @@ if (ENABLE_BUILD_DOXYGEN)
150156
add_subdirectory(documentation)
151157
endif()
152158

153-
if (ENABLE_TESTS)
154-
enable_testing()
155-
if (NOT TARGET build-tests)
156-
add_custom_target(build-tests)
157-
endif()
158-
159-
if (NOT TARGET tests)
160-
add_custom_target(tests
161-
COMMAND ${CMAKE_CTEST_COMMAND}
162-
EXCLUDE_FROM_ALL)
163-
endif ()
164-
add_dependencies(tests build-tests)
165-
add_subdirectory (tests EXCLUDE_FROM_ALL)
166-
167-
# The following forces tests to be built when using "make ctest" even if some targets
168-
# are EXCLUDE_FROM_ALL
169-
# From https://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests/56448477#56448477
170-
build_command(CTEST_CUSTOM_PRE_TEST TARGET build-tests)
171-
string(CONFIGURE \"@CTEST_CUSTOM_PRE_TEST@\" CTEST_CUSTOM_PRE_TEST_QUOTED ESCAPE_QUOTES)
172-
file(WRITE "${CMAKE_BINARY_DIR}/CTestCustom.cmake" "set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST_QUOTED})" "\n")
159+
if (NOT TARGET build-tests)
160+
add_custom_target(build-tests)
173161
endif()
174162

163+
if (NOT TARGET tests)
164+
add_custom_target(tests
165+
COMMAND ${CMAKE_CTEST_COMMAND}
166+
EXCLUDE_FROM_ALL)
167+
endif ()
168+
add_dependencies(tests build-tests)
169+
add_subdirectory (tests EXCLUDE_FROM_ALL)
170+
171+
# The following forces tests to be built when using "make ctest" even if some targets
172+
# are EXCLUDE_FROM_ALL
173+
# From https://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests/56448477#56448477
174+
build_command(CTEST_CUSTOM_PRE_TEST TARGET build-tests)
175+
string(CONFIGURE \"@CTEST_CUSTOM_PRE_TEST@\" CTEST_CUSTOM_PRE_TEST_QUOTED ESCAPE_QUOTES)
176+
file(WRITE "${CMAKE_BINARY_DIR}/CTestCustom.cmake" "set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST_QUOTED})" "\n")
177+
175178
# The following is needed for external projects using *nix make when
176179
# parent project builds pFUnit as a subproject.
177180
set (top_dir PFUNIT-${PFUNIT_VERSION_MAJOR}.${PFUNIT_VERSION_MINOR})

ChangeLog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
## [4.10.0] - 2024-07-10
9+
10+
### Changed
11+
12+
- Updated pFUnit to use v2 template interfaces
13+
- Added `-quiet` flag for NAG Fortran
14+
- Remove `macos-11` from GitHub Actions, add `macos-12` and `gfortran-14` to Ubuntu 24.04
15+
- Updated fArgParse to v1.8.0
16+
17+
### Added
18+
19+
- LLVMFlang compiler support
20+
21+
### Fixed
22+
23+
- Fixes some ctest failures
24+
825
## [4.9.0] - 2024-02-06
926

1027
### Added

bin/tests/inputs/MpiParameterizedTestCaseC.pf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module TestCaseC_mod
1+
module MpiParameterizedTestCaseC
22
use pfunit_mod
33
implicit none
44

@@ -117,6 +117,6 @@ contains
117117

118118
end function toString
119119

120-
end module TestCaseC_mod
120+
end module MpiParameterizedTestCaseC
121121

122122

bin/tests/inputs/MpiTestCaseB.pf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module MpiTestCaseB_mod
1+
module MpiTestCaseB
22
use pfunit_mod
33
implicit none
44

@@ -35,6 +35,6 @@ contains
3535
class (MpiTestCaseB), intent(inout) :: this
3636
end subroutine testB
3737

38-
end module MpiTestCaseB_mod
38+
end module MpiTestCaseB
3939

4040

bin/tests/inputs/ParameterizedTestCaseB.pf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module TestCaseB_mod
1+
module ParameterizedTestCaseB
22
use pfunit_mod
33
implicit none
44

@@ -64,6 +64,6 @@ contains
6464

6565
end function toString
6666

67-
end module TestCaseB_mod
67+
end module ParameterizedTestCaseB
6868

6969

bin/tests/inputs/TestA.pf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module TestA_mod
1+
module TestA
22
use pfunit_mod
33
implicit none
44

@@ -19,6 +19,6 @@ contains
1919
class (MpiTestMethod), intent(inout) :: this
2020
end subroutine testMethodC
2121

22-
end module TestA_mod
22+
end module TestA
2323

2424

bin/tests/inputs/TestCaseA.pf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module TestCaseA_mod
1+
module TestCaseA
22
use pfunit_mod
33
implicit none
44

@@ -35,4 +35,4 @@ contains
3535
class (TestCaseA), intent(inout) :: this
3636
end subroutine testB
3737

38-
end module TestCaseA_mod
38+
end module TestCaseA

cmake/LLVMFlang.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Compiler specific flags for LLVM Flang
2+
3+
set(cpp "-cpp")
4+
5+
set(common_flags "${cpp}")
6+
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g ${common_flags}")
7+
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${common_flags}")

0 commit comments

Comments
 (0)