Skip to content

Commit

Permalink
Fix example build with meson (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi authored Jul 3, 2024
1 parent b273c5e commit 9d572e3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,24 @@ jobs:
run: |
pip install cmake fpm meson ninja
- name: Build Fortuno
- name: Build Fortuno with CMake
run: |
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -B ${BUILD_DIR} -G Ninja
cmake --build ${BUILD_DIR}
cmake --install ${BUILD_DIR}
rm -rf ${BUILD_DIR}
- name: Build Fortuno with Fpm
run: |
fpm build
rm -rf build
- name: Build Fortuno with Meson
run: |
meson setup -Dbuild_examples=true ${BUILD_DIR}
ninja -C ${BUILD_DIR}
rm -rf ${BUILD_DIR}
- name: Test CMake export
run: |
CMAKE_PREFIX_PATH=${INSTALL_DIR} cmake -B ${BUILD_DIR} -G Ninja test/export
Expand Down
8 changes: 4 additions & 4 deletions example/fixtured_module_tests.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

! This example illustrates how to use module variables as fixtures. Note that the test procedures
! access the module variable containing the fixture data directly via host association for
! simplicity. If any test modifies a module variable, the tests will no longer be independent. As an
! alternative, you could derive a new test case class by extending serial_case_base, where test
! procedures receive the fixture data as `intent(in)` arguments. For further details, refer to the
! example on fixtured tests.
! simplicity. If any test modifies this module variable, the tests will no longer be independent. As
! a more robust alternative, you could derive a new test case class by extending serial_case_base
! and enforce that the test procedures receive the fixture data as an "intent(in)" argument. For
! further details, refer to the example on fixtured tests.

module fixtured_module_tests
use mylib, only : factorial
Expand Down
2 changes: 2 additions & 0 deletions example/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ example_mylib_dep = declare_dependency(
example_testapp_exe = executable(
'testapp',
sources: [
'fixtured_module_tests.f90',
'fixtured_suite_tests.f90',
'fixtured_tests.f90',
'parametrized_tests.f90',
'simple_tests.f90',
Expand Down

0 comments on commit 9d572e3

Please sign in to comment.