Skip to content

Commit

Permalink
Merge pull request #427 from Mikolaj-A-Kowalski/fix-relpaths
Browse files Browse the repository at this point in the history
Restore consistent behaviour between `*_sources.cmake` and `*_ctest.cmake`
  • Loading branch information
tclune authored Jun 26, 2023
2 parents 06a6a4b + 1617595 commit 247e23b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Restored consistent behaviour for file paths between `add_pfunit_ctest` amd `add_pfunit_sources`.
Now the `add_pfunit_ctest` handles relative filepaths (e.g. `./path/to/source.pf`) as described
in the script documentation.

## [4.7.1] - 2023-06-26

### Fixed
Expand Down
11 changes: 6 additions & 5 deletions include/add_pfunit_ctest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,18 @@ function (add_pfunit_ctest test_package_name)

set (test_sources_f90)
set (test_suites_inc "")
foreach (pf_file ${PF_TEST_TEST_SOURCES})

# Create contents of the test_suites files
foreach (pf_file ${PF_TEST_TEST_SOURCES})
get_filename_component (basename ${pf_file} NAME_WE)
set (f90_file "${basename}.F90")
list (APPEND test_sources_f90 ${f90_file})
set (test_suites_inc "${test_suites_inc}ADD_TEST_SUITE(${basename}_suite)\n")
add_pfunit_sources(test_sources_f90 ${PF_TEST_TEST_SOURCES})

endforeach()


# Preprocess test files
# F90 files are set in test_sources_f90
add_pfunit_sources(test_sources_f90 ${PF_TEST_TEST_SOURCES})

if (PF_TEST_EXTRA_USE)
set(PFUNIT_EXTRA_USE ${PF_TEST_EXTRA_USE})
endif()
Expand Down

0 comments on commit 247e23b

Please sign in to comment.