unit_test_system(3f) - [M_framework__verify] return status from system command (LICENSE:PD)
Synopsis
Description
Options
Examples
Author
License
function unit_test_system(cmd,verbose)
character(len=*),intent(in) :: cmd logical,intent(in),optional :: verbose
unit_test_system(3f) executes a system command and returns the exit status of the command.
command system command to execute. If it starts with "* " the asterisk is replaced by the name of the current command. If it starts with "** " the asterisks are replaced by the current command including arguments. verbose if .true. the executed command is echoed to output. The default is .false.
Sample program:
program demo_unit_test_system use M_framework, only: & unit_test_start, & unit_test, & unit_test_system, & unit_test_end implicit none if (command_argument_count() == 0) then call unit_test_start(myroutine) call unit_test(false, unit_test_system(false) == 0, check false) call unit_test(true, unit_test_system(true) == 0, check true) call unit_test(notthere, unit_test_system(notthere) == 0, & & check notthere) call unit_test(*,& & unit_test_system(* and options, verbose=.true.) == 0, check "*") call unit_test_end(myroutine) else write (*, *) called with an option endif end program demo_unit_test_system
John S. Urban
Public Domain
Nemo Release 3.1 | unit_test_system (3) | February 23, 2025 |