Lines Matching +full:sub +full:- +full:system
1 # Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
32 OpenSSL::Test - a private extension of Test::More
44 indir "subdir" => sub {
62 recipe C<$SRCTOP/test/recipes/99-foo.t>, there could be a directory
63 C<$SRCTOP/test/recipes/99-foo_data/>.
93 # is defined with a non-empty value.
105 exit_checker => sub { return shift == 0 ? 1 : 0 },
129 variable if defined, otherwise C<$BLDTOP/test-runs> or C<$TOP/test-runs>,
136 sub setup {
155 unless -f srctop_file("Configure");
165 =item B<indir "SUBDIR" =E<gt> sub BLOCK, OPTS>
185 indir "foo" => sub {
199 sub indir {
208 $codeblock->();
285 interpreter_args => [ "-I", srctop_dir("test") ])));
299 indir "foo", sub {
311 sub cmd {
314 return sub {
325 sub app {
328 return sub {
332 exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
336 sub fuzz {
339 return sub {
343 exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
347 sub test {
350 return sub {
354 exe_shell => $ENV{EXE_SHELL}, %opts) -> (shift);
358 sub perlapp {
361 return sub {
368 @prog, @cmdargs ], %opts) -> (shift);
372 sub perltest {
375 return sub {
382 @prog, @cmdargs ], %opts) -> (shift);
406 If false or not given, the command will be executed with C<system()>,
431 sub run {
432 my ($cmd, $display_cmd) = shift->(0);
455 # In non-verbose, we want to shut up the command interpreter, in case
476 open($pipe, '-|', "$prefix$cmd") or die "Can't start command: $!";
488 system("$prefix$cmd");
492 $r = $hooks{exit_checker}->($e);
514 # non-zero.
525 my $tb = Test::More->builder;
526 my $failure = scalar(grep { $_ == 0; } $tb->summary);
554 operating system.
560 sub bldtop_dir {
564 croak "$d isn't a directory" if -e $d && ! -d $d;
576 operating system.
582 sub bldtop_file {
585 croak "$f isn't a file" if -e $f && ! -f $f;
597 operating system.
603 sub srctop_dir {
607 croak "$d isn't a directory" if -e $d && ! -d $d;
619 operating system.
625 sub srctop_file {
628 croak "$f isn't a file" if -e $f && ! -f $f;
639 operating system.
645 sub data_dir {
648 croak "$d isn't a directory" if -e $d && ! -d $d;
659 file path as a string, adapted to the local operating system.
665 sub data_file {
668 croak "$f isn't a file" if -e $f && ! -f $f;
679 operating system.
685 sub result_dir {
690 croak "$d isn't a directory" if -e $d && ! -d $d;
701 file path as a string, adapted to the local operating system.
707 sub result_file {
712 croak "$f isn't a file" if -e $f && ! -f $f;
729 sub pipe {
732 sub {
738 my ($c, $dc, @el) = $_->(++$counter);
778 sub with {
790 $codeblock->();
826 sub cmdstr {
827 my ($cmd, $display_cmd) = shift->(0);
852 sub openssl_versions {
906 sub ok_nofips {
911 sub is_nofips {
916 sub isnt_nofips {
939 is located. Defaults to C<$TOP/apps> (adapted to the operating system).
944 are located. Defaults to C<$TOP/test> (adapted to the operating system).
961 sub __env {
974 $directories{RESULTTOP} = $ENV{RESULT_D} || __bldtop_dir("test-runs");
983 delete $directories{SRCDATA} unless -d $directories{SRCDATA};
1003 sub __srctop_file {
1010 sub __srctop_dir {
1016 sub __bldtop_file {
1023 sub __bldtop_dir {
1032 sub __exeext {
1051 sub __test_file {
1057 $out = catfile($directories{SRCTEST},@_,$f) unless -f $out;
1061 sub __apps_file {
1067 $out = catfile($directories{SRCAPPS},@_,$f) unless -f $out;
1071 sub __fuzz_file {
1077 $out = catfile($directories{SRCFUZZ},@_,$f) unless -f $out;
1081 sub __data_file {
1090 sub __data_dir {
1107 sub __cwd {
1160 # %directories the same was as the paths in %directories, so any sub
1220 sub __wrap_cmd {
1255 sub __fixup_prg {
1271 sub __decorate_cmd {
1280 my $fileornull = sub { $_[0] ? $_[0] : $null; };
1285 $stdin = " < ".$fileornull->($opts{stdin}) if exists($opts{stdin});
1286 $stdout= " > ".$fileornull->($opts{stdout}) if exists($opts{stdout});
1287 $stderr=" 2> ".$fileornull->($opts{stderr}) if exists($opts{stderr});
1319 sub subtest {
1324 $level--;