Skip to content

Commit

Permalink
Make add_pfunit_ctest work with rel paths again
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj-A-Kowalski committed May 9, 2023
1 parent 74e6f4a commit 7f023b5
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.0] - 2023-04-17

### Changed
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 7f023b5

Please sign in to comment.