Skip to content

Commit

Permalink
Fix various build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Aug 16, 2024
1 parent fc47602 commit bc3c0d5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
if: ${{ contains(matrix.compiler, 'intel') }}
uses: rscohn2/setup-oneapi@v0
with:
components: ifx
# Note: intel 2024.1 and 2024.2 fail to build Fortuno properly due to a compiler bug,
# see https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-Procedure-pointer-association-status-gets-lost/m-p/1612121#M172850
components: ifx@2024.0.0

- name: Setup Intel environment
if: ${{ contains(matrix.compiler, 'intel') }}
Expand Down
5 changes: 4 additions & 1 deletion include/fortuno_serial.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
#! constructor: Name of the constructor to use (default: "test")
#!
#:def TEST_ITEMS(label="", suffix="", constructor="serial_case_item ")
#:set items = _fortuno_registered_tests[label]
#:set items = _fortuno_registered_tests.get(label)
#:if items is None
#:stop "Undefined label ('{}') used in TEST_ITEMS()".format(label)
#:endif
$:_fortuno_constructed_tests.update(set([(label, item['name']) for item in items]))
#:set calls = [f"{constructor}('{item['name']}', {item['proc']})" for item in items]
#:set lines = " " + ",&\n ".join(calls) + suffix + "&\n"
Expand Down
36 changes: 27 additions & 9 deletions test/export/app/testapp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,40 @@
! Licensed under the BSD-2-Clause Plus Patent license.
! SPDX-License-Identifier: BSD-2-Clause-Patent

!> Test app driving Fortuno unit tests
program testapp
use fortuno_serial, only : execute_serial_cmd_app, is_equal, test => serial_case_item,&
check => serial_check
!> Unit tests
module testapp_tests
use fortuno_serial, only : is_equal, test => serial_case_item, check => serial_check, test_item
implicit none

call execute_serial_cmd_app(&
testitems=[&
test("success", test_success)&
]&
)
private
public :: test_items

contains


subroutine test_success()
call check(is_equal(1, 1))
end subroutine test_success


function test_items() result(testitems)
type(test_item), allocatable :: testitems(:)

testitems = [&
test("success", test_success)&
]

end function test_items

end module testapp_tests


!> Test app driving Fortuno unit tests
program testapp
use testapp_tests, only : test_items
use fortuno_serial, only : execute_serial_cmd_app
implicit none

call execute_serial_cmd_app(testitems=test_items())

end program testapp
25 changes: 16 additions & 9 deletions test/export/app/testapp_fypp.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@

#:include "fortuno_serial.fypp"

!> Test app driving Fortuno unit tests
program testapp_fypp
use fortuno_serial, only : execute_serial_cmd_app, is_equal, test_item
!> Unit tests
module testapp_fypp_tests
use fortuno_serial, only : is_equal, test_item
$:FORTUNO_SERIAL_IMPORTS()
implicit none

call execute_serial_cmd_app(&
testitems=[&
test_items()&
]&
)
private
public :: test_items

contains


$:TEST("success")
@:CHECK(is_equal(1, 1))
$:END_TEST()
Expand All @@ -33,4 +29,15 @@ contains

end function test_items

end module testapp_fypp_tests


!> Test app driving Fortuno unit tests
program testapp_fypp
use testapp_fypp_tests, only : test_items
use fortuno_serial, only : execute_serial_cmd_app
implicit none

call execute_serial_cmd_app(testitems=test_items())

end program testapp_fypp

0 comments on commit bc3c0d5

Please sign in to comment.