C Library Functions  - unit_test_start (3)

NAME

unit_test_start(3f) - [M_verify] call command "goodbad NAME start" and optionally set options (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Author
License

SYNOPSIS

subroutine unit_test_start(name,options,msg)

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

DESCRIPTION

unit_test_start(3f) is an initialization command that by default calls the shell command

      goodbad NAME start [options]

The command can be changed by setting the environment variable unit_test_COMMAND or the global module variable unit_test_COMMAND. The environment variable overrides the global module variable.

By default if a unit_test(3f) logical expression is false or the unit_test_bad(3f) procedure is called the program will be stopped.

This has the same effect as setting the environment variable M_verify_STOP to "FALSE" or the global module variable unit_test_KEEP_GOING to .FALSE. . Set the value to .true. and the program will continue even when tests fail.

OPTIONS

NAME name of the shell command to execute. If blank, no command is executed.
OPTIONS
  pass additional options to the shell command
MSG print message

EXAMPLES

Sample program:

    program demo_unit_test_start
    use M_verify, only: unit_test_start
    use M_verify, only: unit_test
    use M_verify, only: unit_test_done

implicit none integer :: ival call unit_test_start(’myroutine’) ! the goodbad(1) command called here takes many options ! used to build an SQLite3 entry call unit_test_start(’myroutine_long’,’ & & -section 3 & & -library libGPF & & -filename ‘pwd‘/M_verify.FF & & -documentation y & & -prep y & & -ccall n & & -archive GPF.a & & ’)

ival=10 call unit_test(’myroutine’, ival > 3 , msg=’test if big enough’) call unit_test(’myroutine’, ival < 100 , msg=’test if small enough’)

call unit_test_done(’myroutine’,msg=’completed checks of "myroutine"’)

end program demo_unit_test_start

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 unit_test_start (3) June 29, 2025
Generated by manServer 1.08 from 445e97a5-6c64-499d-9be0-2791bc05b2ae using man macros.