mirror of
https://github.com/openssl/openssl.git
synced 2024-12-18 14:33:42 +08:00
Test suite: minimal required to get mingw 'make test' work under Linux.
(part by Alessandro Ghedini) Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
1dce6c3f9e
commit
4ada8be2a6
@ -8,6 +8,9 @@ use OpenSSL::Test qw/:DEFAULT top_dir top_file/;
|
|||||||
|
|
||||||
setup("test_verify");
|
setup("test_verify");
|
||||||
|
|
||||||
|
plan skip_all => "no rehash.time was found."
|
||||||
|
unless (-f top_file("rehash.time"));
|
||||||
|
|
||||||
plan tests => 1;
|
plan tests => 1;
|
||||||
|
|
||||||
note("Expect some failures and expired certificate");
|
note("Expect some failures and expired certificate");
|
||||||
|
@ -414,7 +414,7 @@ sub testssl {
|
|||||||
map { split(/:/, $_) }
|
map { split(/:/, $_) }
|
||||||
run(app(["openssl", "ciphers", "${_}:$ciphers"]),
|
run(app(["openssl", "ciphers", "${_}:$ciphers"]),
|
||||||
capture => 1);
|
capture => 1);
|
||||||
chomp @c;
|
map { s/\R//; } @c; # chomp @c;
|
||||||
$protocolciphersuitcount += scalar @c;
|
$protocolciphersuitcount += scalar @c;
|
||||||
$_ => [ @c ] } @protocols;
|
$_ => [ @c ] } @protocols;
|
||||||
|
|
||||||
|
@ -68,14 +68,14 @@ sub tconversion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($testtype ne "p7d") {
|
if ($testtype ne "p7d") {
|
||||||
is(compare_text("$testtype-fff.p", "$testtype-f.p"), 0,
|
is(cmp_text("$testtype-fff.p", "$testtype-f.p"), 0,
|
||||||
'comparing orig to p');
|
'comparing orig to p');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $to (@conversionforms) {
|
foreach my $to (@conversionforms) {
|
||||||
next if $to eq "d";
|
next if $to eq "d";
|
||||||
foreach my $from (@conversionforms) {
|
foreach my $from (@conversionforms) {
|
||||||
is(compare_text("$testtype-f.$to", "$testtype-ff.$from$to"), 0,
|
is(cmp_text("$testtype-f.$to", "$testtype-ff.$from$to"), 0,
|
||||||
"comparing $to to $from$to");
|
"comparing $to to $from$to");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,4 +85,12 @@ sub tconversion {
|
|||||||
unlink glob "$testtype-fff.*";
|
unlink glob "$testtype-fff.*";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub cmp_text {
|
||||||
|
return compare_text(@_, sub {
|
||||||
|
$_[0] =~ s/\R//g;
|
||||||
|
$_[1] =~ s/\R//g;
|
||||||
|
return $_[0] ne $_[1];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -357,7 +357,7 @@ operating system.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub top_dir {
|
sub top_dir {
|
||||||
return __top_file(@_, ""); # This caters for operating systems that have
|
return __top_dir(@_); # This caters for operating systems that have
|
||||||
# a very distinct syntax for directories.
|
# a very distinct syntax for directories.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -577,6 +577,12 @@ sub __top_file {
|
|||||||
return catfile($directories{TOP},@_,$f);
|
return catfile($directories{TOP},@_,$f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub __top_dir {
|
||||||
|
BAIL_OUT("Must run setup() first") if (! $test_name);
|
||||||
|
|
||||||
|
return catdir($directories{TOP},@_);
|
||||||
|
}
|
||||||
|
|
||||||
sub __test_file {
|
sub __test_file {
|
||||||
BAIL_OUT("Must run setup() first") if (! $test_name);
|
BAIL_OUT("Must run setup() first") if (! $test_name);
|
||||||
|
|
||||||
@ -668,7 +674,9 @@ sub __fixup_cmd {
|
|||||||
my $prefix = __top_file("util", "shlib_wrap.sh")." ";
|
my $prefix = __top_file("util", "shlib_wrap.sh")." ";
|
||||||
my $ext = $ENV{"EXE_EXT"} || "";
|
my $ext = $ENV{"EXE_EXT"} || "";
|
||||||
|
|
||||||
if ( $^O eq "VMS" ) { # VMS
|
if (defined($ENV{EXE_SHELL})) {
|
||||||
|
$prefix = "$ENV{EXE_SHELL} ";
|
||||||
|
} elsif ($^O eq "VMS" ) { # VMS
|
||||||
$prefix = "mcr ";
|
$prefix = "mcr ";
|
||||||
$ext = ".exe";
|
$ext = ".exe";
|
||||||
} elsif ($^O eq "MSWin32") { # Windows
|
} elsif ($^O eq "MSWin32") { # Windows
|
||||||
|
@ -46,7 +46,7 @@ my $disabled_set = 0;
|
|||||||
sub check_disabled {
|
sub check_disabled {
|
||||||
#print STDERR "Running check_disabled\n";
|
#print STDERR "Running check_disabled\n";
|
||||||
foreach (run(app(["openssl", "list", "-disabled"]), capture => 1)) {
|
foreach (run(app(["openssl", "list", "-disabled"]), capture => 1)) {
|
||||||
chomp;
|
s/\R//; # chomp;
|
||||||
next if /:/; # skip header
|
next if /:/; # skip header
|
||||||
$disabled{lc $_} = 1;
|
$disabled{lc $_} = 1;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
|
|||||||
export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
|
export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmd="$1${EXE_EXT}"
|
cmd="$1"; [ -x "$cmd" ] || cmd="$cmd${EXE_EXT}"
|
||||||
shift
|
shift
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
exec "$cmd" # old sh, such as Tru64 4.x, fails to expand empty "$@"
|
exec "$cmd" # old sh, such as Tru64 4.x, fails to expand empty "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user