Unverified Commit e86db639 authored by boklm's avatar boklm
Browse files

Add logs of failing tests in the index

parent 3def2b43
......@@ -25,6 +25,7 @@ BEGIN {
my %template_functions = (
is_test_error => \&TBBTestSuite::Tests::is_test_error,
is_test_warning => \&TBBTestSuite::Tests::is_test_warning,
test_by_name => \&TBBTestSuite::Tests::test_by_name,
);
sub set_report_dir {
......
......@@ -74,6 +74,14 @@ sub is_success {
return 1;
}
sub test_by_name {
my ($tests, $name) = @_;
foreach my $test (@$tests) {
return $test if $test->{name} eq $name;
}
return undef;
}
sub matching_tbbfile {
my $o = tbb_filename_infos($_[0]);
return $o->{type} eq 'browserbundle' && $o->{os} eq $options->{os}
......
[% IF ! from_index %]
[% IF test.results.failed.size %]
Failed tests:
<ul>
......@@ -7,4 +8,5 @@ Failed tests:
</ul>
[% END %]
<a href="javascript:togglecontent('logs_[% test.name %]');">xpcshell logs</a>
<pre id="logs_[% test.name %]" style="display:none">[% test.results.out %]</pre>
[% END %]
<pre [% IF ! from_index %]id="logs_[% report_name %][% test.name %]" style="display:none"[% END %]>[% test.results.out %]</pre>
......@@ -12,15 +12,7 @@
color: #FF0000;
}
</style>
<script language="JavaScript" type="text/javascript">
function togglecontent(id) {
if (document.getElementById(id).style.display == "none") {
document.getElementById(id).style.display = '';
} else {
document.getElementById(id).style.display = "none";
}
}
</script>
[% INCLUDE togglecontent.js %]
</head>
<body>
[% IF tbbfiles.$tbbfile.type == 'browserunit' %]
......
......@@ -22,6 +22,7 @@
font-size: small;
}
</style>
[% INCLUDE togglecontent.js %]
</head>
<body>
<h1>Tor Browser Unit Test Reports</h1>
......@@ -49,7 +50,12 @@
<li><b>[% diff.fail_tests.size %] new failing tests</b>
<ul>
[% FOREACH t IN diff.fail_tests.sort %]
<li>[% t %]</li>
<li><a href="javascript:togglecontent('fail_test_[% report %]_[% t %]');">[% t %]</a>
<div id="fail_test_[% report %]_[% t %]" style="display:none">
[% SET test = test_by_name(tbbfiles.$tbbfile.tests, t); %]
[% SET type = test.type; INCLUDE "details_${type}.html" from_index=1 %]
</div>
</li>
[% END %]
</ul>
</li>
......@@ -66,6 +72,11 @@
<li>[% js %]</li>
[% END %]
</ul>
<a href="javascript:togglecontent('js_fail_test_[% report %]_[% t %]');">logs</a>
<div id="js_fail_test_[% report %]_[% t %]" style="display:none">
[% SET test = test_by_name(tbbfiles.$tbbfile.tests, t); %]
[% SET type = test.type; INCLUDE "details_${type}.html" from_index=1 %]
</div>
</li>
[% END %]
</ul>
......
<script language="JavaScript" type="text/javascript">
function togglecontent(id) {
if (document.getElementById(id).style.display == "none") {
document.getElementById(id).style.display = '';
} else {
document.getElementById(id).style.display = "none";
}
}
</script>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment