summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2013-01-01 20:56:16 -0800
committerMatthieu Patou <mat@samba.org>2013-01-09 07:19:54 +0100
commit09b00108069f16a6a654b88b4d87fbd3f566f2f0 (patch)
tree103bc5dbd6ed924379f357c3e0bf6f45f609aca5 /script
parent0c86126d166c8f75bd3593fce077f26bca51f8aa (diff)
downloadsamba-09b00108069f16a6a654b88b4d87fbd3f566f2f0.tar.gz
samba-09b00108069f16a6a654b88b4d87fbd3f566f2f0.tar.bz2
samba-09b00108069f16a6a654b88b4d87fbd3f566f2f0.zip
script: Add a script to display testsuite runtime sorted
Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script')
-rwxr-xr-xscript/show_testsuite_time40
1 files changed, 40 insertions, 0 deletions
diff --git a/script/show_testsuite_time b/script/show_testsuite_time
new file mode 100755
index 0000000000..40153218f5
--- /dev/null
+++ b/script/show_testsuite_time
@@ -0,0 +1,40 @@
+#!/usr/bin/env perl
+use Time::Local ('timegm');
+my $in = STDIN;
+use strict;
+
+my $intest=0;
+my $name;
+my $start=0;
+my $end=0;
+my %hash;
+my $fh;
+if ($#ARGV >= 0) {
+ open($fh, "<", $ARGV[0]) || die "can't open ".$ARGV[0];
+} else {
+ $fh = $in;
+}
+while(<$fh>)
+{
+ if (m/^testsuite: (.*)/) {
+ $intest = 1;
+ $name = $1;
+ }
+ if (m/testsuite-\w+:/) {
+ $hash{"$name -> ".($end - $start)} = $end - $start;
+ $intest = 0;
+ $start = 0;
+ }
+ if (m/^time: (\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/ && $intest) {
+ my $ts=timegm($6,$5,$4,$3,$2 - 1,$1 - 1900);
+ if ($start == 0) {
+ $start = $ts;
+ } else {
+ $end = $ts;
+ }
+ }
+}
+my @sorted = sort { $hash{$a}<=>$hash{$b} } keys(%hash);
+for my $l (@sorted) {
+ print $l."\n";
+}