m_unitTester.f90 Source File

This File Depends On

sourcefile~~m_unittester.f90~~EfferentGraph sourcefile~m_unittester.f90 m_unitTester.f90 sourcefile~m_errors.f90 m_errors.f90 sourcefile~m_errors.f90->sourcefile~m_unittester.f90 sourcefile~m_variablekind.f90 m_variableKind.f90 sourcefile~m_variablekind.f90->sourcefile~m_unittester.f90 sourcefile~m_variablekind.f90->sourcefile~m_errors.f90
Help

Files Dependent On This One

sourcefile~~m_unittester.f90~~AfferentGraph sourcefile~m_unittester.f90 m_unitTester.f90 sourcefile~test_coretran.f90 test_coretran.f90 sourcefile~m_unittester.f90->sourcefile~test_coretran.f90 sourcefile~m_fileio.f90 m_fileIO.f90 sourcefile~m_unittester.f90->sourcefile~m_fileio.f90 sourcefile~m_maths.f90 m_maths.f90 sourcefile~m_unittester.f90->sourcefile~m_maths.f90 sourcefile~m_allocate.f90 m_allocate.f90 sourcefile~m_unittester.f90->sourcefile~m_allocate.f90 sourcefile~m_random.f90 m_random.f90 sourcefile~m_unittester.f90->sourcefile~m_random.f90 sourcefile~m_tests.f90 m_tests.f90 sourcefile~m_unittester.f90->sourcefile~m_tests.f90 sourcefile~m_fileio.f90->sourcefile~m_tests.f90 sourcefile~scale_coretran.f90 scale_coretran.f90 sourcefile~m_fileio.f90->sourcefile~scale_coretran.f90 sourcefile~m_maths.f90->sourcefile~m_tests.f90 sourcefile~m_maths.f90->sourcefile~scale_coretran.f90 sourcefile~m_kdtree.f90 m_KdTree.f90 sourcefile~m_maths.f90->sourcefile~m_kdtree.f90 sourcefile~m_allocate.f90->sourcefile~m_maths.f90 sourcefile~m_allocate.f90->sourcefile~m_random.f90 sourcefile~m_allocate.f90->sourcefile~m_tests.f90 sourcefile~m_allocate.f90->sourcefile~scale_coretran.f90 sourcefile~m_allocate.f90->sourcefile~m_kdtree.f90 sourcefile~prng_class.f90 Prng_Class.f90 sourcefile~m_allocate.f90->sourcefile~prng_class.f90 sourcefile~m_reallocate.f90 m_reallocate.f90 sourcefile~m_allocate.f90->sourcefile~m_reallocate.f90 sourcefile~iddynamicarray_class.f90 idDynamicArray_Class.f90 sourcefile~m_allocate.f90->sourcefile~iddynamicarray_class.f90 sourcefile~rdynamicarray_class.f90 rDynamicArray_Class.f90 sourcefile~m_allocate.f90->sourcefile~rdynamicarray_class.f90 sourcefile~idynamicarray_class.f90 iDynamicArray_Class.f90 sourcefile~m_allocate.f90->sourcefile~idynamicarray_class.f90 sourcefile~m_array1d.f90 m_array1D.f90 sourcefile~m_allocate.f90->sourcefile~m_array1d.f90 sourcefile~ddynamicarray_class.f90 dDynamicArray_Class.f90 sourcefile~m_allocate.f90->sourcefile~ddynamicarray_class.f90 sourcefile~m_copy.f90 m_copy.f90 sourcefile~m_allocate.f90->sourcefile~m_copy.f90 sourcefile~m_random.f90->sourcefile~test_coretran.f90 sourcefile~m_random.f90->sourcefile~m_tests.f90 sourcefile~m_random.f90->sourcefile~scale_coretran.f90 sourcefile~m_random.f90->sourcefile~m_array1d.f90 sourcefile~m_tests.f90->sourcefile~test_coretran.f90 sourcefile~m_kdtree.f90->sourcefile~m_tests.f90 sourcefile~m_kdtree.f90->sourcefile~scale_coretran.f90 sourcefile~prng_class.f90->sourcefile~m_random.f90 sourcefile~prng_class.f90->sourcefile~m_tests.f90 sourcefile~m_reallocate.f90->sourcefile~m_tests.f90 sourcefile~m_reallocate.f90->sourcefile~scale_coretran.f90 sourcefile~m_reallocate.f90->sourcefile~iddynamicarray_class.f90 sourcefile~m_reallocate.f90->sourcefile~rdynamicarray_class.f90 sourcefile~m_reallocate.f90->sourcefile~idynamicarray_class.f90 sourcefile~m_reallocate.f90->sourcefile~ddynamicarray_class.f90 sourcefile~iddynamicarray_class.f90->sourcefile~m_tests.f90 sourcefile~idargdynamicarray_class.f90 idArgDynamicArray_Class.f90 sourcefile~iddynamicarray_class.f90->sourcefile~idargdynamicarray_class.f90 sourcefile~rdynamicarray_class.f90->sourcefile~m_tests.f90 sourcefile~rargdynamicarray_class.f90 rArgDynamicArray_Class.f90 sourcefile~rdynamicarray_class.f90->sourcefile~rargdynamicarray_class.f90 sourcefile~idynamicarray_class.f90->sourcefile~m_tests.f90 sourcefile~idynamicarray_class.f90->sourcefile~m_kdtree.f90 sourcefile~idynamicarray_class.f90->sourcefile~idargdynamicarray_class.f90 sourcefile~idynamicarray_class.f90->sourcefile~rargdynamicarray_class.f90 sourcefile~dargdynamicarray_class.f90 dArgDynamicArray_Class.f90 sourcefile~idynamicarray_class.f90->sourcefile~dargdynamicarray_class.f90 sourcefile~iargdynamicarray_class.f90 iArgDynamicArray_Class.f90 sourcefile~idynamicarray_class.f90->sourcefile~iargdynamicarray_class.f90 sourcefile~m_array1d.f90->sourcefile~m_maths.f90 sourcefile~m_array1d.f90->sourcefile~m_tests.f90 sourcefile~m_array1d.f90->sourcefile~scale_coretran.f90 sourcefile~m_array1d.f90->sourcefile~m_kdtree.f90 sourcefile~ddynamicarray_class.f90->sourcefile~m_tests.f90 sourcefile~ddynamicarray_class.f90->sourcefile~dargdynamicarray_class.f90 sourcefile~m_copy.f90->sourcefile~m_tests.f90 sourcefile~m_copy.f90->sourcefile~scale_coretran.f90 sourcefile~idargdynamicarray_class.f90->sourcefile~m_tests.f90 sourcefile~rargdynamicarray_class.f90->sourcefile~m_tests.f90 sourcefile~dargdynamicarray_class.f90->sourcefile~m_tests.f90 sourcefile~dargdynamicarray_class.f90->sourcefile~m_kdtree.f90 sourcefile~iargdynamicarray_class.f90->sourcefile~m_tests.f90
Help

Source Code


Source Code

module m_unitTester

use iso_fortran_env, only: output_unit
use variableKind, only: i32
use m_errors, only: msg

implicit none

private

public :: tester

type tester
  private
  integer(i32) :: total
  integer(i32) :: success
contains
  procedure, public :: test => test_tester
  procedure, public :: summary => summary_tester
end type

interface tester
  module procedure :: init_tester
end interface

contains

function init_tester() result(this)
  type(tester) :: this
  this%total = 0
  this%success = 0
end function

subroutine test_tester(this, l, msg)
  class(tester) :: this
  logical :: l
  character(len=*) :: msg
  this%total = this%total + 1
  if (l) then
    write(output_unit,1) msg//' Passed!'
    this%success = this%success + 1
  else
    write(output_unit,1) msg//' Failed!'
  endif
1 format(a)
end subroutine

subroutine summary_tester(this)
  class(tester) :: this
  call Msg('==========================')
  write(output_unit,1) this%success,'/',this%total,' tests passed'
  call Msg('==========================')
1 format(i0,a,i0,a)
end subroutine


end module