julienne_test_m.F90 Source File


This file depends on

sourcefile~~julienne_test_m.f90~~EfferentGraph sourcefile~julienne_test_m.f90 julienne_test_m.F90 sourcefile~julienne_command_line_m.f90 julienne_command_line_m.f90 sourcefile~julienne_test_m.f90->sourcefile~julienne_command_line_m.f90 sourcefile~julienne_test_result_m.f90 julienne_test_result_m.f90 sourcefile~julienne_test_m.f90->sourcefile~julienne_test_result_m.f90 sourcefile~julienne_user_defined_collectives_m.f90 julienne_user_defined_collectives_m.f90 sourcefile~julienne_test_m.f90->sourcefile~julienne_user_defined_collectives_m.f90 sourcefile~julienne_string_m.f90 julienne_string_m.f90 sourcefile~julienne_test_result_m.f90->sourcefile~julienne_string_m.f90 sourcefile~julienne_test_diagnosis_m.f90 julienne_test_diagnosis_m.F90 sourcefile~julienne_test_result_m.f90->sourcefile~julienne_test_diagnosis_m.f90 sourcefile~julienne_test_diagnosis_m.f90->sourcefile~julienne_string_m.f90

Files dependent on this one

sourcefile~~julienne_test_m.f90~~AfferentGraph sourcefile~julienne_test_m.f90 julienne_test_m.F90 sourcefile~julienne_m.f90 julienne_m.f90 sourcefile~julienne_m.f90->sourcefile~julienne_test_m.f90 sourcefile~julienne_test_s.f90 julienne_test_s.F90 sourcefile~julienne_test_s.f90->sourcefile~julienne_test_m.f90 sourcefile~assertions.f90 assertions.F90 sourcefile~assertions.f90->sourcefile~julienne_m.f90 sourcefile~check-for-command-line-argument.f90 check-for-command-line-argument.f90 sourcefile~check-for-command-line-argument.f90->sourcefile~julienne_m.f90 sourcefile~get-command-line-flag-value.f90 get-command-line-flag-value.f90 sourcefile~get-command-line-flag-value.f90->sourcefile~julienne_m.f90

Source Code

! Copyright (c) 2024-2025, The Regents of the University of California and Sourcery Institute
! Terms of use are as specified in LICENSE.txt

#include "language-support.F90"

module julienne_test_m
  !! Define an abstract test_t type with deferred bindings ("subject" and "results")
  !! used by a type-bound procedure ("report") for reporting test results.  The "report"
  !! procedure thus represents an implementation of the Template Method pattern.
  use julienne_test_result_m, only : test_result_t
  use julienne_user_defined_collectives_m, only : co_all
  use julienne_command_line_m, only : command_line_t

  implicit none

  private
  public :: test_t, test_description_substring

  character(len=:), allocatable, protected :: test_description_substring

  type, abstract :: test_t
    !! Facilitate testing and test reporting
  contains
    procedure(subject_interface), nopass, deferred :: subject 
    procedure(results_interface), nopass, deferred :: results
    procedure :: report
  end type

  abstract interface

    pure function subject_interface() result(specimen_description)
      !! The result is the name of the test specimen (the subject of testing)
      character(len=:), allocatable :: specimen_description
    end function

    function results_interface() result(test_results)
      !! The result is an array of test results for subsequent reporting in the "report" type-bound procedure
      import test_result_t
      type(test_result_t), allocatable :: test_results(:)
    end function

  end interface

  interface

    module subroutine report(test, passes, tests, skips)
      !! Print the test results and increment the tallies of passing tests, total tests, and skipped tests.
      implicit none
      class(test_t), intent(in) :: test
      integer, intent(inout) :: passes, tests, skips
    end subroutine

  end interface

end module julienne_test_m