mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 07:55:43 +01:00
Merge remote-tracking branch 'upstream-public/pr/2061' into development
This commit is contained in:
commit
d07ef47150
@ -76,7 +76,7 @@ TEST_OUTPUT=out_${PPID}
|
|||||||
cd tests
|
cd tests
|
||||||
|
|
||||||
# Step 2a - Unit Tests
|
# Step 2a - Unit Tests
|
||||||
perl scripts/run-test-suites.pl -v |tee unit-test-$TEST_OUTPUT
|
perl scripts/run-test-suites.pl -v 2 |tee unit-test-$TEST_OUTPUT
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Step 2b - System Tests
|
# Step 2b - System Tests
|
||||||
|
@ -24,14 +24,10 @@ use strict;
|
|||||||
use utf8;
|
use utf8;
|
||||||
use open qw(:std utf8);
|
use open qw(:std utf8);
|
||||||
|
|
||||||
use constant FALSE => 0;
|
use Getopt::Long;
|
||||||
use constant TRUE => 1;
|
|
||||||
|
|
||||||
my $verbose;
|
my $verbose = 0;
|
||||||
my $switch = shift;
|
GetOptions( "verbose|v:1" => \$verbose );
|
||||||
if ( defined($switch) && ( $switch eq "-v" || $switch eq "--verbose" ) ) {
|
|
||||||
$verbose = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
# All test suites = executable files, excluding source files, debug
|
# All test suites = executable files, excluding source files, debug
|
||||||
# and profiling information, etc. We can't just grep {! /\./} because
|
# and profiling information, etc. We can't just grep {! /\./} because
|
||||||
@ -50,10 +46,20 @@ my ($failed_suites, $total_tests_run, $failed, $suite_cases_passed,
|
|||||||
$suite_cases_failed, $suite_cases_skipped, $total_cases_passed,
|
$suite_cases_failed, $suite_cases_skipped, $total_cases_passed,
|
||||||
$total_cases_failed, $total_cases_skipped );
|
$total_cases_failed, $total_cases_skipped );
|
||||||
|
|
||||||
|
sub pad_print_center {
|
||||||
|
my( $width, $padchar, $string ) = @_;
|
||||||
|
my $padlen = ( $width - length( $string ) - 2 ) / 2;
|
||||||
|
print $padchar x( $padlen ), " $string ", $padchar x( $padlen ), "\n";
|
||||||
|
}
|
||||||
|
|
||||||
for my $suite (@suites)
|
for my $suite (@suites)
|
||||||
{
|
{
|
||||||
print "$suite ", "." x ( 72 - length($suite) - 2 - 4 ), " ";
|
print "$suite ", "." x ( 72 - length($suite) - 2 - 4 ), " ";
|
||||||
my $result = `$prefix$suite`;
|
my $command = "$prefix$suite";
|
||||||
|
if( $verbose ) {
|
||||||
|
$command .= ' -v';
|
||||||
|
}
|
||||||
|
my $result = `$command`;
|
||||||
|
|
||||||
$suite_cases_passed = () = $result =~ /.. PASS/g;
|
$suite_cases_passed = () = $result =~ /.. PASS/g;
|
||||||
$suite_cases_failed = () = $result =~ /.. FAILED/g;
|
$suite_cases_failed = () = $result =~ /.. FAILED/g;
|
||||||
@ -61,15 +67,25 @@ for my $suite (@suites)
|
|||||||
|
|
||||||
if( $result =~ /PASSED/ ) {
|
if( $result =~ /PASSED/ ) {
|
||||||
print "PASS\n";
|
print "PASS\n";
|
||||||
|
if( $verbose > 2 ) {
|
||||||
|
pad_print_center( 72, '-', "Begin $suite" );
|
||||||
|
print $result;
|
||||||
|
pad_print_center( 72, '-', "End $suite" );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$failed_suites++;
|
$failed_suites++;
|
||||||
print "FAIL\n";
|
print "FAIL\n";
|
||||||
|
if( $verbose ) {
|
||||||
|
pad_print_center( 72, '-', "Begin $suite" );
|
||||||
|
print $result;
|
||||||
|
pad_print_center( 72, '-', "End $suite" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($passed, $tests, $skipped) = $result =~ /([0-9]*) \/ ([0-9]*) tests.*?([0-9]*) skipped/;
|
my ($passed, $tests, $skipped) = $result =~ /([0-9]*) \/ ([0-9]*) tests.*?([0-9]*) skipped/;
|
||||||
$total_tests_run += $tests - $skipped;
|
$total_tests_run += $tests - $skipped;
|
||||||
|
|
||||||
if ( $verbose ) {
|
if( $verbose > 1 ) {
|
||||||
print "(test cases passed:", $suite_cases_passed,
|
print "(test cases passed:", $suite_cases_passed,
|
||||||
" failed:", $suite_cases_failed,
|
" failed:", $suite_cases_failed,
|
||||||
" skipped:", $suite_cases_skipped,
|
" skipped:", $suite_cases_skipped,
|
||||||
@ -87,7 +103,7 @@ print "-" x 72, "\n";
|
|||||||
print $failed_suites ? "FAILED" : "PASSED";
|
print $failed_suites ? "FAILED" : "PASSED";
|
||||||
printf " (%d suites, %d tests run)\n", scalar @suites, $total_tests_run;
|
printf " (%d suites, %d tests run)\n", scalar @suites, $total_tests_run;
|
||||||
|
|
||||||
if ( $verbose ) {
|
if( $verbose > 1 ) {
|
||||||
print " test cases passed :", $total_cases_passed, "\n";
|
print " test cases passed :", $total_cases_passed, "\n";
|
||||||
print " failed :", $total_cases_failed, "\n";
|
print " failed :", $total_cases_failed, "\n";
|
||||||
print " skipped :", $total_cases_skipped, "\n";
|
print " skipped :", $total_cases_skipped, "\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user