Module: tools Branch: master Commit: 24b1fef48314cc526b20f8f08ab077aa27b16800 URL: http://source.winehq.org/git/tools.git/?a=commit;h=24b1fef48314cc526b20f8f08...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Mar 29 00:38:40 2017 +0200
winetest/gather: Show the short date in the index titles and headers.
Since there is only one build per day, using the short date is just as unique while being more readable and shorter. It has the additional advantage of being ordered unlike the build id (*) which makes the browser tab names more meaningful. The build id is still shown in the page header in addition to the short date since there is more space there and it is used for linking to other pages.
(*) 'Mar 15' is clearly older than 'Mar 17' whereas no such determination can be made from '6a05069a' and 'c3b108e5' alone.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
winetest/gather | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-)
diff --git a/winetest/gather b/winetest/gather index a0cb9b7..26bc612 100755 --- a/winetest/gather +++ b/winetest/gather @@ -45,7 +45,7 @@ sub BEGIN } unshift @INC, $1 if ($0 =~ m=^(/.*)/[^/]+$=); } -use vars qw/$datadir $gitweb/; +use vars qw/$datadir $gitdir $gitweb/; require "winetest.conf";
my $name0=$0; @@ -55,6 +55,38 @@ $name0 =~ s+^.*/++; my $summary_version=4;
+$ENV{GIT_DIR} = $gitdir; + +sub get_build_info($) +{ + my ($build) = @_; + my ($date, $subject); + + my $commit = `git log --max-count=1 --pretty="format:%ct %s" "$build^0" 2>/dev/null` if ($build =~ /^[0-9a-f]{40}$/); + if ($commit && $commit =~ /^(\d+) (.*)$/) + { + ($date, $subject) = ($1, $2); + # Make sure the directory's mtime matches the commit time + utime $date, $date, "$datadir/$build"; + } + else + { + $date = (stat "$datadir/$build")[9]; + $subject = ""; + } + return ($date, $subject); +} + +use POSIX qw(locale_h strftime); +setlocale(LC_ALL, "C"); + +sub short_date($) +{ + my ($date) = @_; + return strftime("%b %d", gmtime($date)); +} + + # A test name is of the form 'dll:unit' where: # dll Is the dll being tested. # unit Is a unit test composed of multiple individual checks testing @@ -131,6 +163,7 @@ my ($outdated,undef) = glob "$datadir/*/outdated"; exit 2 unless defined $outdated; (my $build = $outdated) =~ s|^\Q$datadir\E/(.*)/outdated$|$1|; (my $release = $build) =~ s/^(\d+).*$/$1/; +my ($date, $_subject) = get_build_info($build);
# Read in the data
@@ -420,6 +453,7 @@ EOF
my $header_footer=build_header_footer(@groups); my $short_build = substr($build,0,12); +my $short_date = short_date($date);
my $legend = "<div class="legend"> @@ -616,14 +650,14 @@ sub output_table($) { $group_name = $group->{name}; $header_footer = build_header_footer($group->{reports}); - $title = "$group_name results for build $short_build"; + $title = "$short_date: $group_name results"; $filename = "index_$group_name.html"; } else { $group_name = "global"; $header_footer = build_header_footer(@groups); - $title = "Summary for build $short_build"; + $title = "$short_date: Summary"; $filename = "index.html"; }
@@ -657,7 +691,7 @@ EOF print OUT " | <a href="..">index</a>\n"; print OUT "</div>\n"; print OUT "<div class="group">\n"; - print OUT "<h1>$group_name results for build <a href="." title="$build">$short_build</a></h1>\n"; + print OUT "<h1>$short_date: $group_name results for build <a href="." title="$build">$short_build</a></h1>\n"; print OUT "<table class="report">\n$header_footer\n <tbody>\n"; } else @@ -668,7 +702,7 @@ EOF print OUT " | <a href="..">index</a>"; print OUT "</div>\n"; print OUT "<div class="main">\n"; - print OUT "<h1>Main summary for build $short_build</h1>\n"; + print OUT "<h1>$short_date: Summary for build $short_build</h1>\n"; print OUT "<table class="report">\n$header_footer\n <tbody>\n"; }