Add a script for formating test result of st/subunit
authorMatthieu Patou <mat@matws.net>
Fri, 22 Oct 2010 07:56:40 +0000 (11:56 +0400)
committerMatthieu Patou <mat@samba.org>
Tue, 26 Oct 2010 20:42:11 +0000 (20:42 +0000)
This script show the time of each test and tests are sorted by execution
time (from the slowest to the quickest)

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Tue Oct 26 20:42:11 UTC 2010 on sn-devel-104

source4/scripting/devel/show_test_time [new file with mode: 0755]

diff --git a/source4/scripting/devel/show_test_time b/source4/scripting/devel/show_test_time
new file mode 100755 (executable)
index 0000000..d9a18f0
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env perl
+#
+use strict;
+my %h;
+open(FH, "subunit-ls --times --no-passthrough|") || die "pb with subunit-ls";
+while(<FH>)
+{
+       chomp();
+       my @l = split(/ /);
+       my $val = @l[scalar(@l)-1];
+       $h{join(' ',@l)} = $val;
+}
+
+my @sorted = sort { $h{$b}<=>$h{$a} } keys(%h);
+use Data::Dumper;
+foreach my $l (@sorted)
+{
+       print "$l\n";
+}