LCOV - code coverage report
Current view: top level - math/test/src - test_math.f90 (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 54 54
Test Date: 2025-05-08 18:23:42 Functions: 100.0 % 2 2

            Line data    Source code
       1            1 : program test_math
       2              : 
       3            1 :    use const_lib, only: const_init
       4              :    use utils_lib
       5              :    use math_lib
       6              : 
       7              :    implicit none
       8              : 
       9              :    real(dp), parameter :: XS(3) = [0.1_dp, 0.2_dp, 0.4_dp]
      10              : 
      11              :    integer  :: i
      12            1 :    real(dp) :: x
      13              : 
      14              :    ! for testhub information
      15              :    integer :: iounit, ierr
      16              :    character(len=strlen) :: compiler_name, compiler_version_name, mesasdk_version_name
      17              : 
      18            1 :    call math_init()
      19              : 
      20            1 :    write (*, *) MATH_BACKEND
      21              : 
      22            1 :    write (*, *)
      23              : 
      24            4 :    do i = 1, SIZE(XS)
      25              : 
      26            3 :       x = XS(i)
      27              : 
      28            3 :       print 100, 'Function', 'Value (x= ', x, ' )'
      29              : 100   format(1X, A10, 1X, A10, E24.16, A2)
      30              : 
      31            3 :       write (*, 110) 'log', log(x)
      32            3 :       write (*, 110) 'log10', log10(x)
      33            3 :       write (*, 110) 'log1p', log1p(x)
      34            3 :       write (*, 110) 'log2', log2(x)
      35            3 :       write (*, 110) 'safe_log', safe_log(x)
      36            3 :       write (*, 110) 'safe_log10', safe_log10(x)
      37            3 :       write (*, 110) 'exp', exp(x)
      38            3 :       write (*, 110) 'exp10', exp10(x)
      39            3 :       write (*, 110) 'expm1', expm1(x)
      40            3 :       write (*, 110) 'pow(,2)', pow(x, 2)
      41            3 :       write (*, 110) 'pow(,2.)', pow(x, 2._dp)
      42            3 :       write (*, 110) 'pow2', pow2(x)
      43            3 :       write (*, 110) 'pow3', pow3(x)
      44            3 :       write (*, 110) 'pow4', pow4(x)
      45            3 :       write (*, 110) 'pow5', pow5(x)
      46            3 :       write (*, 110) 'pow6', pow6(x)
      47            3 :       write (*, 110) 'pow7', pow7(x)
      48            3 :       write (*, 110) 'pow8', pow8(x)
      49            3 :       write (*, 110) 'cos', cos(x)
      50            3 :       write (*, 110) 'sin', sin(x)
      51            3 :       write (*, 110) 'tan', tan(x)
      52            3 :       write (*, 110) 'cospi', cospi(x)
      53            3 :       write (*, 110) 'sinpi', sinpi(x)
      54            3 :       write (*, 110) 'tanpi', tanpi(x)
      55            3 :       write (*, 110) 'acos', acos(x)
      56            3 :       write (*, 110) 'asin', asin(x)
      57            3 :       write (*, 110) 'atan', atan(x)
      58            3 :       write (*, 110) 'acospi', acospi(x)
      59            3 :       write (*, 110) 'asinpi', asinpi(x)
      60            3 :       write (*, 110) 'atanpi', atanpi(x)
      61            3 :       write (*, 110) 'cosh', cosh(x)
      62            3 :       write (*, 110) 'sinh', sinh(x)
      63            3 :       write (*, 110) 'tanh', tanh(x)
      64              : 
      65              : 110   format(1X, A10, 1X, E24.16)
      66              : 
      67            4 :       print *
      68              : 
      69              :    end do
      70              : 
      71              :    ! write information for MESA TestHub
      72              : 
      73            1 :    call get_compiler_version(compiler_name, compiler_version_name)
      74            1 :    call get_mesasdk_version(mesasdk_version_name, ierr)
      75              : 
      76            1 :    open (newunit=iounit, file='../../testhub.yml')
      77            1 :    write (iounit, '(A)') '# This file is generated by math/test (see src/test_math.f90)'
      78            1 :    write (iounit, '(A)') '---'
      79            1 :    write (iounit, '(A)') 'compiler: '//"'"//trim(compiler_name)//"'"
      80            1 :    write (iounit, '(A)') 'compiler_version: '//"'"//trim(compiler_version_name)//"'"
      81            1 :    write (iounit, '(A)') 'sdk_version: '//"'"//trim(mesasdk_version_name)//"'"
      82            1 :    write (iounit, '(A)') 'math_backend: '//"'"//trim(math_backend)//"'"
      83            1 :    close (iounit)
      84              : 
      85            1 : end program test_math
      86              : 
        

Generated by: LCOV version 2.0-1