select_test Function

public function select_test(tests, name) result(pos)

Select a unit test from all available tests

Arguments

Type IntentOptional Attributes Name
type(unittest_type) :: tests(:)

Available unit tests

character(len=*), intent(in) :: name

Name identifying the test suite

Return Value integer

Selected test suite


Source Code

function select_test(tests, name) result(pos)

   !> Name identifying the test suite
   character(len=*), intent(in) :: name

   !> Available unit tests
   type(unittest_type) :: tests(:)

   !> Selected test suite
   integer :: pos

   integer :: it

   pos = 0
   do it = 1, size(tests)
      if (name == tests(it)%name) then
         pos = it
         exit
      end if
   end do

end function select_test