aboutsummaryrefslogtreecommitdiffstats
path: root/fips/mkfipsscr.pl
diff options
context:
space:
mode:
Diffstat (limited to 'fips/mkfipsscr.pl')
-rwxr-xr-xfips/mkfipsscr.pl37
1 files changed, 31 insertions, 6 deletions
diff --git a/fips/mkfipsscr.pl b/fips/mkfipsscr.pl
index dc60cdf5804b..361641d36eca 100755
--- a/fips/mkfipsscr.pl
+++ b/fips/mkfipsscr.pl
@@ -297,12 +297,16 @@ my $filter = "";
my $tvdir;
my $tprefix;
my $shwrap_prefix;
+my $shwrap;
+my $rmcmd = "rm -rf";
+my $mkcmd = "mkdir";
my $debug = 0;
my $quiet = 0;
my $rspdir = "rsp";
my $rspignore = 0;
my @bogus = (); # list of unmatched *.rsp files
my $bufout = '';
+my $bufdir = '';
my %_programs = (); # list of external programs to check
foreach (@ARGV)
@@ -331,6 +335,10 @@ foreach (@ARGV)
{
$rspdir = $1;
}
+ elsif (/--noshwrap$/)
+ {
+ $shwrap = "";
+ }
elsif (/--rspignore$/)
{
$rspignore = 1;
@@ -347,6 +355,14 @@ foreach (@ARGV)
{
$filter = $1;
}
+ elsif (/--mkdir=(.*)$/)
+ {
+ $mkcmd = $1;
+ }
+ elsif (/--rm=(.*)$/)
+ {
+ $rmcmd = $1;
+ }
elsif (/--outfile=(.*)$/)
{
$outfile = $1;
@@ -396,6 +412,8 @@ else
$shwrap_prefix = "../util/" unless defined $shwrap_prefix;
}
+ $shwrap = "${shwrap_prefix}shlib_wrap.sh " unless defined $shwrap;
+
$bufinit .= <<END;
#!/bin/sh
@@ -403,6 +421,9 @@ else
# Auto generated by mkfipsscr.pl script
# Do not edit
+RM="$rmcmd"
+MKDIR="$mkcmd"
+TPREFIX=$tprefix
END
}
@@ -546,7 +567,7 @@ sub test_dir
{
$rsp =~ tr|/|\\|;
$req =~ tr|/|\\|;
- $bufout .= <<END;
+ $bufdir = <<END;
echo Running tests in $req
if exist "$rsp" rd /s /q "$rsp"
@@ -555,11 +576,11 @@ END
}
else
{
- $bufout .= <<END;
+ $bufdir = <<END;
echo Running tests in "$req"
-rm -rf "$rsp"
-mkdir "$rsp"
+\$RM "$rsp"
+\$MKDIR "$rsp"
END
}
@@ -571,6 +592,10 @@ sub test_line
my ($win32, $req, $tprefix, $tnam) = @_;
my $rsp = $req;
my $tcmd = $fips_tests{$tnam};
+
+ $bufout .= $bufdir;
+ $bufdir = "";
+
$rsp =~ s/req\/([^\/]*).req$/$rspdir\/$1.rsp/;
if ($tcmd =~ /-f$/)
{
@@ -584,7 +609,7 @@ sub test_line
else
{
$bufout .= <<END;
-${shwrap_prefix}shlib_wrap.sh $tprefix$tcmd "$req" "$rsp" || { echo "$req failure" ; exit 1
+${shwrap}\${TPREFIX}$tcmd "$req" "$rsp" || { echo "$req failure" ; exit 1
}
END
$_programs{"${shwrap_prefix}shlib_wrap.sh"} = 1;
@@ -624,7 +649,7 @@ END
else
{
$bufout .= <<END;
-${shwrap_prefix}shlib_wrap.sh $tprefix$tcmd < "$req" > "$rsp" || { echo "$req failure" ; exit 1; }
+${shwrap}\${TPREFIX}$tcmd < "$req" > "$rsp" || { echo "$req failure" ; exit 1; }
END
$_programs{"$tprefix$tcmd"} = 1;
}