Skip to content

Commit

Permalink
Remove depndencies from template include files
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Oct 28, 2024
1 parent e9c9d9f commit 8b3300a
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 47 deletions.
26 changes: 26 additions & 0 deletions src/fortuno/checkers/int32.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,33 @@

!> Contains some built-in checkers instantiations (32 bit integer)
module fortuno_checkers_int32
! Template parameters
use fortuno_env, only : ik => i32
use fortuno_chartypes, only : value_item => int32_item
! Template dependencies
use fortuno_env, only : i64
use fortuno_checkers_helpers, only : add_shape_mismatch_details, add_value_mismatch_details
use fortuno_testinfo, only : check_result
implicit none

private
public :: is_equal, all_equal


!> Checks whether two entities are equal
interface is_equal
module procedure is_equal_r0
end interface is_equal


!> Checks whether all entities in an array are equal
interface all_equal
module procedure is_equal_r0
module procedure all_equal_r1, all_equal_r2
end interface all_equal

contains

include 'int_template.inc'

end module fortuno_checkers_int32
26 changes: 26 additions & 0 deletions src/fortuno/checkers/int64.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,33 @@

!> Contains some built-in checkers instantiations (64 bit real)
module fortuno_checkers_int64
! Template parameters
use fortuno_env, only : ik => i64
use fortuno_chartypes, only : value_item => int64_item
! Template dependencies
use fortuno_env, only : i64
use fortuno_checkers_helpers, only : add_shape_mismatch_details, add_value_mismatch_details
use fortuno_testinfo, only : check_result
implicit none

private
public :: is_equal, all_equal


!> Checks whether two entities are equal
interface is_equal
module procedure is_equal_r0
end interface is_equal


!> Checks whether all entities in an array are equal
interface all_equal
module procedure is_equal_r0
module procedure all_equal_r1, all_equal_r2
end interface all_equal

contains

include 'int_template.inc'

end module fortuno_checkers_int64
24 changes: 0 additions & 24 deletions src/fortuno/checkers/int_template.inc
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
use fortuno_env, only : i64
use fortuno_checkers_helpers, only : add_shape_mismatch_details, add_value_mismatch_details
use fortuno_testinfo, only : check_result
implicit none

private
public :: is_equal, all_equal


!> Checks whether two entities are equal
interface is_equal
module procedure is_equal_r0
end interface is_equal


!> Checks whether all entities in an array are equal
interface all_equal
module procedure is_equal_r0
module procedure all_equal_r1, all_equal_r2
end interface all_equal


contains


!> Checks whether two integer values are equal
function is_equal_r0(value1, value2) result(checkresult)
Expand Down
26 changes: 26 additions & 0 deletions src/fortuno/checkers/real32.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,33 @@

!> Contains some built-in checkers instantiations (32 bit real)
module fortuno_checkers_real32
! Template parameters
use fortuno_env, only : rk => r32
use fortuno_chartypes, only : value_item => real32_item
! Template dependencies
use fortuno_env, only : i64
use fortuno_checkfuncs, only : is_close_elem
use fortuno_checkers_helpers, only : add_shape_mismatch_details, add_value_mismatch_details
use fortuno_testinfo, only : check_result
implicit none

private
public :: is_close, all_close

!> Checks whether two entities are close each other
interface is_close
module procedure is_close_r0
end interface is_close


!> Checks whether all entities in an array are close to each other
interface all_close
module procedure is_close_r0
module procedure all_close_r1, all_close_r2
end interface all_close

contains

include 'real_template.inc'

end module fortuno_checkers_real32
26 changes: 26 additions & 0 deletions src/fortuno/checkers/real64.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,33 @@

!> Contains some built-in checkers instantiations (64 bit real)
module fortuno_checkers_real64
! Template parameters
use fortuno_env, only : rk => r64
use fortuno_chartypes, only : value_item => real64_item
! Template dependencies
use fortuno_env, only : i64
use fortuno_checkfuncs, only : is_close_elem
use fortuno_checkers_helpers, only : add_shape_mismatch_details, add_value_mismatch_details
use fortuno_testinfo, only : check_result
implicit none

private
public :: is_close, all_close

!> Checks whether two entities are close each other
interface is_close
module procedure is_close_r0
end interface is_close


!> Checks whether all entities in an array are close to each other
interface all_close
module procedure is_close_r0
module procedure all_close_r1, all_close_r2
end interface all_close

contains

include 'real_template.inc'

end module fortuno_checkers_real64
23 changes: 0 additions & 23 deletions src/fortuno/checkers/real_template.inc
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
use fortuno_env, only : i64
use fortuno_checkfuncs, only : is_close_elem
use fortuno_checkers_helpers, only : add_shape_mismatch_details, add_value_mismatch_details
use fortuno_testinfo, only : check_result
implicit none

private
public :: is_close, all_close

!> Checks whether two entities are close each other
interface is_close
module procedure is_close_r0
end interface is_close


!> Checks whether all entities in an array are close to each other
interface all_close
module procedure is_close_r0
module procedure all_close_r1, all_close_r2
end interface all_close

contains


!> Checks whether two real numbers are close to each other.
function is_close_r0(value1, value2, atol, rtol) result(checkresult)
Expand Down

0 comments on commit 8b3300a

Please sign in to comment.