Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
tor-browser-bundle-testsuite
Commits
88db319d
Unverified
Commit
88db319d
authored
Aug 27, 2014
by
boklm
Browse files
Allow setting tags on reports
And generate index pages per tag.
parent
194b17a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
TBBTestSuite/Reports.pm
View file @
88db319d
...
...
@@ -108,12 +108,17 @@ sub make_reports_index {
my
@reports_by_time
=
sort
{
$reports
{
$b
}
->
{
time
}
<=>
$reports
{
$a
}
->
{
time
}
}
keys
%reports
;
my
%reports_by_tbbversion
;
my
%reports_by_tag
;
my
%reports_by_type
;
foreach
my
$report
(
keys
%reports
)
{
my
$tbbver
=
$reports
{
$report
}
->
{
options
}{
tbbversion
};
push
@
{
$reports_by_tbbversion
{
$tbbver
}},
$report
if
$tbbver
;
my
$type
=
report_type
(
$reports
{
$report
});
push
@
{
$reports_by_type
{
$type
}},
$report
;
my
$tags
=
$reports
{
$report
}
->
{
options
}{
tags
}
//
[]
;
foreach
my
$tag
(
ref
$tags
?
@$tags
:
(
$tags
))
{
push
@
{
$reports_by_tag
{
$type
}
->
{
$tag
}},
$report
;
}
my
$testsuite
=
$
TBBTestSuite::Tests::
testsuite_types
{
$type
};
$testsuite
->
{
pre_reports_index
}(
\
%reports
,
$reports
{
$report
})
if
$testsuite
->
{
pre_reports_index
};
...
...
@@ -143,6 +148,15 @@ sub make_reports_index {
{
%$vars
,
reports_list
=>
\
@s
},
"
index-
$type
.html
")
||
exit_error
"
Template Error:
\n
"
.
$template
->
error
;
}
foreach
my
$type
(
keys
%reports_by_tag
)
{
foreach
my
$tag
(
keys
%
{
$reports_by_tag
{
$type
}})
{
my
@s
=
sort
{
$reports
{
$b
}
->
{
time
}
<=>
$reports
{
$a
}
->
{
time
}
}
@
{
$reports_by_tag
{
$type
}
->
{
$tag
}};
$template
->
process
("
reports_index_
$type
.html
",
{
%$vars
,
reports_list
=>
\
@s
},
"
index-
$type
-
$tag
.html
")
||
exit_error
"
Template Error:
\n
"
.
$template
->
error
;
}
}
}
sub
text_report
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment