Stop warnings about undefined _exit on Android.

Additional script output options to fipsalgtest.pl
This commit is contained in:
Dr. Stephen Henson 2011-04-28 12:20:12 +00:00
parent 7c50694f05
commit 1eb8939695
3 changed files with 24 additions and 7 deletions

View File

@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(__unix) || defined(__unix__)
#if defined(__unix) || defined(__unix__) || defined(__ANDROID__)
#include <unistd.h>
#endif

View File

@ -1 +1 @@
HMAC-SHA1(fips_premain.c)= dab2842517034a42dfdb21a285d4f0f4d7f6f920
HMAC-SHA1(fips_premain.c)= 5f546af6cad8753df3956d233db9a6d7cce505aa

View File

@ -462,6 +462,8 @@ my $minimal_script = 0;
my $outfile = '';
my $no_warn_missing = 0;
my $no_warn_bogus = 0;
my $rmcmd = "rm -rf";
my $mkcmd = "mkdir";
my %fips_enabled = (
dsa => 1,
@ -549,6 +551,15 @@ foreach (@ARGV) {
elsif (/--filter=(.*)$/) {
$filter = $1;
}
elsif (/--rm=(.*)$/) {
$rmcmd = $1;
}
elsif (/--script-tprefix=(.*)$/) {
$stprefix = $1;
}
elsif (/--mkdir=(.*)$/) {
$mkcmd = $1;
}
elsif (/^--list-tests$/) {
$list_tests = 1;
}
@ -861,7 +872,8 @@ echo Running Algorithm Tests
END
} else {
print OUT <<\END;
$stprefix = $tprefix unless defined $stprefix;
print OUT <<END;
#!/bin/sh
# Test vector run script
@ -870,6 +882,10 @@ END
echo Running Algorithm Tests
RM="$rmcmd";
MKDIR="$mkcmd";
TPREFIX=$stprefix
END
}
@ -926,8 +942,8 @@ md \"$outdir\"
END
} else {
print OUT <<END
rm -rf \"$outdir\"
mkdir \"$outdir\"
\$RM -rf \"$outdir\"
\$MKDIR \"$outdir\"
END
}
@ -938,12 +954,13 @@ END
mkdir($outdir) || die "Can't create directory $outdir";
}
}
my $cmd = "$tprefix$tcmd \"$req\" \"$out\"";
my $cmd = "$tcmd \"$req\" \"$out\"";
print STDERR "DEBUG: running test $tname\n" if ( $debug && !$verify );
if ($outfile ne "") {
print OUT "echo \" running $tname test\"\n" unless $minimal_script;
print OUT "$cmd\n";
print OUT "\${TPREFIX}$cmd\n";
} else {
$cmd = "$tprefix$cmd";
system($cmd);
if ( $? != 0 ) {
print STDERR