mirror of
https://github.com/samba-team/samba.git
synced 2025-01-21 18:04:06 +03:00
scripts: Allow to specify a limit on the number of tests reported
This allows to report the 10 most slowest for instance. Change-Id: I987520dbc28f598221c47df314d823f916312aab Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
14b5eb90d8
commit
4055eb6b7d
@ -9,11 +9,16 @@ my $start=0;
|
|||||||
my $end=0;
|
my $end=0;
|
||||||
my %hash;
|
my %hash;
|
||||||
my $fh;
|
my $fh;
|
||||||
|
my $max=0;
|
||||||
if ($#ARGV >= 0) {
|
if ($#ARGV >= 0) {
|
||||||
open($fh, "<", $ARGV[0]) || die "can't open ".$ARGV[0];
|
open($fh, "<", $ARGV[0]) || die "can't open ".$ARGV[0];
|
||||||
} else {
|
} else {
|
||||||
$fh = $in;
|
$fh = $in;
|
||||||
}
|
}
|
||||||
|
if ($#ARGV >= 1) {
|
||||||
|
$max = $ARGV[1];
|
||||||
|
}
|
||||||
|
|
||||||
while(<$fh>)
|
while(<$fh>)
|
||||||
{
|
{
|
||||||
if (m/^testsuite: (.*)/) {
|
if (m/^testsuite: (.*)/) {
|
||||||
@ -34,7 +39,8 @@ while(<$fh>)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my @sorted = sort { $hash{$a}<=>$hash{$b} } keys(%hash);
|
my @sorted = sort { $hash{$b}<=>$hash{$a} } keys(%hash);
|
||||||
for my $l (@sorted) {
|
$max = $#sorted unless $max or ($max < $#sorted);
|
||||||
|
for my $l (@sorted[0..($max - 1)]) {
|
||||||
print $l."\n";
|
print $l."\n";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user