mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-29 17:04:16 +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
|
||||
|
||||
# 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
|
||||
|
||||
# Step 2b - System Tests
|
||||
|
@ -24,14 +24,10 @@ use strict;
|
||||
use utf8;
|
||||
use open qw(:std utf8);
|
||||
|
||||
use constant FALSE => 0;
|
||||
use constant TRUE => 1;
|
||||
use Getopt::Long;
|
||||
|
||||
my $verbose;
|
||||
my $switch = shift;
|
||||
if ( defined($switch) && ( $switch eq "-v" || $switch eq "--verbose" ) ) {
|
||||
$verbose = TRUE;
|
||||
}
|
||||
my $verbose = 0;
|
||||
GetOptions( "verbose|v:1" => \$verbose );
|
||||
|
||||
# All test suites = executable files, excluding source files, debug
|
||||
# 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,
|
||||
$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)
|
||||
{
|
||||
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_failed = () = $result =~ /.. FAILED/g;
|
||||
@ -61,15 +67,25 @@ for my $suite (@suites)
|
||||
|
||||
if( $result =~ /PASSED/ ) {
|
||||
print "PASS\n";
|
||||
if( $verbose > 2 ) {
|
||||
pad_print_center( 72, '-', "Begin $suite" );
|
||||
print $result;
|
||||
pad_print_center( 72, '-', "End $suite" );
|
||||
}
|
||||
} else {
|
||||
$failed_suites++;
|
||||
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/;
|
||||
$total_tests_run += $tests - $skipped;
|
||||
|
||||
if ( $verbose ) {
|
||||
if( $verbose > 1 ) {
|
||||
print "(test cases passed:", $suite_cases_passed,
|
||||
" failed:", $suite_cases_failed,
|
||||
" skipped:", $suite_cases_skipped,
|
||||
@ -87,7 +103,7 @@ print "-" x 72, "\n";
|
||||
print $failed_suites ? "FAILED" : "PASSED";
|
||||
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 " failed :", $total_cases_failed, "\n";
|
||||
print " skipped :", $total_cases_skipped, "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user