77 logical(
LK) :: assertion
79 call sleep(
0.1_RK, Err)
80 assertion
= .not. err
%occurred
87 logical(LK) :: assertion
88 type(SystemInfo_type) :: SystemInfo
90 SystemInfo
= SystemInfo_type(pid
= test%image
%id)
91 assertion
= .not. SystemInfo
%err
%occurred
.and. allocated(SystemInfo
%Records)
.and. size(SystemInfo
%Records)
> 0
105 logical(LK) :: assertion
106 type(EnvVar_type) :: EnvVar
107 assertion
= .true._LK
113 call EnvVar
%get(EnvVar
%name,EnvVar
%val,EnvVar
%length,EnvVar
%Err)
129 logical(LK) :: assertion
130 type(EnvVar_type) :: EnvVar
131 assertion
= .true._LK
136 EnvVar
%name
= SK_
"OS"
137 call EnvVar
%get(EnvVar
%name,EnvVar
%val,EnvVar
%length,EnvVar
%Err)
163 logical(LK) :: assertion
164 type(EnvVar_type) :: EnvVar
165 assertion
= .true._LK
170 EnvVar
%name
= SK_
"OS"
171 call EnvVar
%get(EnvVar
%name, EnvVar
%val,
Err = EnvVar
%Err)
188 logical(LK) :: assertion
189 type(CmdArg_type) :: CmdArg
190 assertion
= .true._LK
196 assertion
= .not. CmdArg
%err
%occurred
197 call test%assert(assertion)
222 logical(LK) :: assertion
225 assertion
= .true._LK
228 mv_osCacheActivated
= .false._LK
229 mc_shellCached
= .false._LK
263 logical(LK) :: assertion
266 assertion
= .true._LK
269 mv_osCacheActivated
= .false._LK
270 mc_shellCached
= .false._LK
276 call OS
%shell
%query()
277 call shell_typer(OS
%Shell)
327 logical(LK) :: assertion
330 assertion
= .true._LK
333 mv_osCacheActivated
= .false._LK
334 mc_shellCached
= .false._LK
340 call OS
%query(shellQueryEnabled
= .false._LK)
359 call OS
%query(shellQueryEnabled
= .true._LK)
388 logical(LK) :: assertion
389 type(SysCmd_type) :: SysCmd
393 assertion
= .not. OS
%err
%occurred
394 call test%assert(assertion)
401 if (OS
%shell
%is
%cmd
.or. OS
%shell
%is
%powershell)
then
402 SysCmd
= SysCmd_type(
"dir > nul 2>&1",
.true._LK)
405 SysCmd
= SysCmd_type(
"dir > nul 2>&1",
.false._LK)
410 if (OS
%shell
%is
%posix)
then
411 SysCmd
= SysCmd_type(
"ls >/dev/null 2>&1",
.true._LK)
414 SysCmd
= SysCmd_type(
"ls >/dev/null 2>&1",
.false._LK)
432 logical(LK) :: assertion
434 integer(IK) :: exitstat
435 logical(LK) ,
parameter :: wait
= .true._LK
436 character(:, SK),
allocatable :: command
439 assertion
= .not. OS
%err
%occurred
440 call test%assert(assertion)
443 if (OS
%shell
%is
%cmd
.or. OS
%shell
%is
%powershell)
then
444 command
= "dir > nul 2>&1"
447 if (OS
%shell
%is
%posix)
then
448 command
= "ls >/dev/null 2>&1"
472 logical(LK) :: assertion
474 character(:, SK),
allocatable :: command
477 assertion
= .not. OS
%err
%occurred
478 call test%assert(assertion)
481 if (OS
%shell
%is
%cmd
.or. OS
%shell
%is
%powershell)
then
482 command
= "dir > nul 2>&1"
485 if (OS
%shell
%is
%posix)
then
486 command
= "ls >/dev/null 2>&1"
503 logical(LK) :: assertion
504 character(:, SK),
allocatable :: newpath
505 logical(LK) :: fileExists
507 newpath
= getPathNew(prefix
= SK_
"test_getPathNew", failed
= assertion)
508 assertion
= .not. assertion
509 call test%assert(assertion)
511 inquire(
file = newpath,
exist = fileExists)
512 assertion
= assertion
.and. .not. fileExists
514 if (
test%traceable
.and. .not. assertion)
then
516 write(
test%disp
%unit,
"(2A)")
517 write(
test%disp
%unit,
"(2A)")
"newpath : ", newpath
529 logical(LK) :: assertion
530 character(:, SK),
allocatable :: newpath
531 logical(LK) :: fileExists
532 integer(IK) :: fileUnit
534 newpath
= getPathNew(prefix
= SK_
"test_getPathNew", failed
= assertion)
535 assertion
= .not. assertion
536 call test%assert(assertion)
538 open(newunit
=fileUnit,file
=newpath,status
="new")
541 call removeFile(path
= newpath,
Err = test%Err)
542 assertion
= assertion
.and. .not. Tes
%err
%occurred
543 call test%assert(assertion)
545 inquire(
file=newpath,
exist=fileExists)
546 assertion
= assertion
.and. .not. fileExists
556 logical(
LK) :: assertion
557 character(:,
SK),
allocatable :: newpath
558 logical(
LK) :: fileExists
559 integer(
IK) :: fileUnit
561 newpath
= getPathNew(prefix
= SK_
"test_getPathNew", failed
= assertion)
562 assertion
= .not. assertion
563 call test%assert(assertion)
565 open(newunit
=fileUnit,file
=newpath,status
="new")
568 call removeFile(path
=newpath)
569 inquire(
file=newpath,
exist=fileExists)
570 assertion
= assertion
.and. .not. fileExists
586 logical(LK) :: assertion
587 type(
css_pdt) ,
allocatable :: List(:)
590 assertion
= .true._LK
596 call getSysInfo(List,Err)
607 logical(
LK) :: assertion
608 character(:,
SK),
allocatable :: newpath
610 logical(
LK) :: fileExists
611 integer(
IK) :: fileUnit
613 newpath
= getPathNew(prefix
= SK_
"test_getPathNew", failed
= assertion)
614 assertion
= .not. assertion
615 call test%assert(assertion)
617 open(newunit
=fileUnit,file
=newpath,status
="new")
621 assertion
= .not. OS
%err
%occurred
622 call test%assert(assertion)
624 assertion
= .not. isFailedCopy(newpath, newpath
//".copy")
625 call test%assert(assertion)
627 inquire(file
=newpath
//".copy",
exist=fileExists)
628 assertion
= assertion
.and. fileExists
630 call removeFile(newpath)
631 inquire(
file=newpath,
exist=fileExists)
632 assertion
= assertion
.and. .not. fileExists
634 call removeFile(newpath
//".copy")
635 inquire(file
=newpath
//".copy",
exist=fileExists)
636 assertion
= assertion
.and. .not. fileExists
Generate and return the input string where the uppercase English alphabets are all converted to lower...
Generate and return failed = .false. if the attempt to run the requested shell command is successful....
Generate and return the conversion of the input value to an output Fortran string,...
This module contains the derived types for generating allocatable containers of scalar,...
This module contains classes and procedures for reporting and handling errors.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
This module contains the uncommon and hardly representable ASCII characters as well as procedures for...
This module contains procedures and generic interfaces for inferring the runtime system shell type an...
character(*, SK), parameter MODULE_NAME
This module contains a simple unit-testing framework for the Fortran libraries, including the ParaMon...
This module contains the generic procedures for converting values of different types and kinds to For...
This module contains tests of the module pm_sysShell.
logical(LK) function test_isFailedExec_2()
Test the success of a SysCmd action.
logical(LK) function test_CmdArg_type_1()
Test whether input command line arguments can be successfully retrieved.
logical(LK) function test_EnvVar_type_2()
Test whether environmental variables can be successfully queried.
logical(LK) function test_removeFile_2()
logical(LK) function test_getSysInfo_1()
Obtain the system info without providing the cachefile name, in which case, no cache file will be gen...
logical(LK) function test_getPathNew_1()
logical(LK) function test_removeFile_1()
logical(LK) function test_SysCmd_type_1()
Test the success of a SysCmd action.
logical(LK) function test_OS_type_1()
Query Shell first and then OS to ensure caching the Shell query results work correctly.
logical(LK) function test_isFailedExec_1()
Test the success of a SysCmd action.
logical(LK) function test_copyFile_1()
logical(LK) function test_OS_type_2()
Query Shell first and then OS to ensure caching the Shell query results work correctly.
logical(LK) function test_SystemInfo_type_1()
logical(LK) function test_OS_type_3()
Query OS first without shell query and then query OS with shell. This will test the remaining uncover...
logical(LK) function test_EnvVar_type_3()
Test whether environmental variables can be successfully queried.
logical(LK) function test_sleep_1()
logical(LK) function test_EnvVar_type_1()
Test whether environmental variables can be successfully queried.
This is the css_pdt parameterized type for generating instances of container of scalar of string obje...
This is the derived type for generating objects to gracefully and verbosely handle runtime unexpected...
This is the derived type test_type for generating objects that facilitate testing of a series of proc...