C Library Functions  - unit_test_stop (3)

NAME

unit_test_stop(3f) - [M_framework__verify] report tally of all checks and stop program (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Author
License

SYNOPSIS

subroutine unit_test_stop(msg,opts)

    character(len=*),intent(in),optional :: msg
    character(len=*),intent(in),optional :: opts

DESCRIPTION

give a tally of all calls to unit_test(3f) and stop program.

Tally up the test result totals and stop the program. If a command is set via unit_test_mode(3f) or the command line call it appending OPTS to the end of the command.

OPTIONS

MSG additional message to display OPTS add string to filter command line if any is specified.

EXAMPLES

Sample program:

    program demo_unit_test_stop
    use M_framework, only: unit_test_start, unit_test_end, &
    & unit_test, unit_test_stop, unit_test_mode
    use,intrinsic :: iso_fortran_env, stdout=>OUTPUT_UNIT
    implicit none
    integer :: x
    x=10
    call unit_test_mode(luns=[stdout])
    ! do a test
    call unit_test_start(’proc1’)
    call unit_test(’proc1’, x > 3 , ’if big enough’)
    call unit_test(’proc1’, x < 100 , ’if small enough’)
    call unit_test_end  (’proc1’,msg=’checks all done’ )
    ! do another test
    call unit_test_start(’proc2’)
    call unit_test(’proc2’, x > 3 , ’if big enough’)
    call unit_test(’proc2’, x < 100 , ’if small enough’)
    call unit_test_end  (’proc2’,msg=’checks all done’ )

! tally up test results and stop program call unit_test_stop()

end program demo_unit_test_stop

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 unit_test_stop (3) July 22, 2023
Generated by manServer 1.08 from c417431a-ed7c-494f-b18d-f6e94424b54d using man macros.