testing YAML_types

This commit is contained in:
Martin Diehl 2023-10-05 16:59:43 +02:00
parent 05e675bbdb
commit b26398319b
5 changed files with 30 additions and 7 deletions

View File

@ -48,7 +48,7 @@ subroutine YAML_parse_init()
#ifdef FYAML #ifdef FYAML
print'(/,1x,a)', 'libfyaml powered' print'(/,1x,a)', 'libfyaml powered'
#else #else
call selfTest() call YAML_parse_selfTest()
#endif #endif
end subroutine YAML_parse_init end subroutine YAML_parse_init
@ -870,7 +870,7 @@ end function to_flow
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Check correctness of some YAML functions. !> @brief Check correctness of some YAML functions.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine selfTest() subroutine YAML_parse_selfTest()
if (indentDepth(' a') /= 1) error stop 'indentDepth' if (indentDepth(' a') /= 1) error stop 'indentDepth'
if (indentDepth('a') /= 0) error stop 'indentDepth' if (indentDepth('a') /= 0) error stop 'indentDepth'
@ -1031,7 +1031,7 @@ subroutine selfTest()
end block parse end block parse
end subroutine selfTest end subroutine YAML_parse_selfTest
#endif #endif
end module YAML_parse end module YAML_parse

View File

@ -150,6 +150,7 @@ module YAML_types
public :: & public :: &
YAML_types_init, & YAML_types_init, &
YAML_types_selfTest, &
#ifdef __GFORTRAN__ #ifdef __GFORTRAN__
output_as1dStr, & !ToDo: Hack for GNU. Remove later output_as1dStr, & !ToDo: Hack for GNU. Remove later
#endif #endif
@ -164,7 +165,7 @@ subroutine YAML_types_init
print'(/,1x,a)', '<<<+- YAML_types init -+>>>' print'(/,1x,a)', '<<<+- YAML_types init -+>>>'
call selfTest() call YAML_types_selfTest()
end subroutine YAML_types_init end subroutine YAML_types_init
@ -172,7 +173,7 @@ end subroutine YAML_types_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Check correctness of some type bound procedures. !> @brief Check correctness of some type bound procedures.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine selfTest() subroutine YAML_types_selfTest()
scalar: block scalar: block
type(tScalar), target :: s type(tScalar), target :: s
@ -266,7 +267,7 @@ subroutine selfTest()
end block dict end block dict
end subroutine selfTest end subroutine YAML_types_selfTest
!--------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------

View File

@ -2223,7 +2223,7 @@ end function crystal_isotropic_mu
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Check correctness of some crystal functions. !> @brief Check correctness of some crystal functions.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine crystal_selfTest subroutine crystal_selfTest()
real(pREAL), dimension(:,:,:), allocatable :: CoSy real(pREAL), dimension(:,:,:), allocatable :: CoSy
real(pREAL), dimension(:,:), allocatable :: system real(pREAL), dimension(:,:), allocatable :: system

View File

@ -12,6 +12,7 @@ program DAMASK_test
use test_crystal use test_crystal
use test_rotations use test_rotations
use test_IO use test_IO
use test_YAML_types
use test_HDF5_utilities use test_HDF5_utilities
external :: quit external :: quit
@ -57,6 +58,10 @@ program DAMASK_test
call test_IO_run() call test_IO_run()
write(IO_STDOUT,fmt='(a)') ok write(IO_STDOUT,fmt='(a)') ok
write(IO_STDOUT,fmt=fmt, advance='no') 'YAML_types','...'
call test_YAML_types_run()
write(IO_STDOUT,fmt='(a)') ok
write(IO_STDOUT,fmt=fmt, advance='no') 'HDF5_utilities','...' write(IO_STDOUT,fmt=fmt, advance='no') 'HDF5_utilities','...'
call test_HDF5_utilities_run() call test_HDF5_utilities_run()
write(IO_STDOUT,fmt='(a)') ok write(IO_STDOUT,fmt='(a)') ok

View File

@ -0,0 +1,17 @@
module test_YAML_types
use YAML_types
implicit none(type,external)
private
public :: test_YAML_types_run
contains
subroutine test_YAML_types_run()
call YAML_types_selfTest()
end subroutine test_YAML_types_run
end module test_YAML_types