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
b0bfc9fb
Unverified
Commit
b0bfc9fb
authored
Aug 25, 2014
by
boklm
Browse files
xpcshell: allow viewing logs for each failed testcase
parent
21f0b1f2
Changes
2
Show whitespace changes
Inline
Side-by-side
TBBTestSuite/BrowserUnitTests.pm
View file @
b0bfc9fb
...
...
@@ -82,8 +82,8 @@ sub tests_by_name {
sub
xpcshell_subtests_diff
{
my
(
$t1
,
$t2
)
=
@_
;
my
(
@fail
,
@fixed
);
my
%f1
=
map
{
$_
=>
1
}
@
{
$t1
->
{
results
}{
failed
}};
my
%f2
=
map
{
$_
=>
1
}
@
{
$t2
->
{
results
}{
failed
}};
my
%f1
=
%
{
$t1
->
{
results
}{
failed
}};
my
%f2
=
%
{
$t2
->
{
results
}{
failed
}};
my
%f
=
(
%f1
,
%f2
);
foreach
my
$t
(
keys
%f
)
{
if
(
$f2
{
$t
}
&&
!
$f1
{
$t
})
{
...
...
@@ -178,7 +178,7 @@ sub xpcshell_test {
capture_exec
('
xvfb-run
',
'
--server-args=-screen 0 1024x768x24
',
'
./mach
',
'
xpcshell-test
',
$test
->
{
dir
});
$test
->
{
results
}{
out
}
=
$out
;
$test
->
{
results
}{
failed
}
=
[]
;
$test
->
{
results
}{
failed
}
=
{}
;
my
$root
=
eval
{
-
f
$xunit_file
&&
XML::
LibXML
->
load_xml
(
location
=>
$xunit_file
)
...
...
@@ -191,7 +191,9 @@ sub xpcshell_test {
$test
->
{
results
}{
success
}
=
(
$root
->
getAttribute
('
failures
')
//
0
)
==
0
;
foreach
my
$testcase
(
@
{
$root
->
getChildrenByLocalName
('
testcase
')})
{
if
(
$testcase
->
getChildrenByLocalName
('
failure
'))
{
push
@
{
$test
->
{
results
}{
failed
}},
$testcase
->
getAttribute
('
name
');
$test
->
{
results
}{
failed
}{
$testcase
->
getAttribute
('
name
')}
=
(
$testcase
->
getChildrenByLocalName
('
failure
'))[
0
]
->
textContent
;
}
}
}
...
...
tmpl/details_xpcshell.html
View file @
b0bfc9fb
[% IF ! from_index %]
[% IF test.results.failed.size %]
[% IF test.results.failed.
keys.
size %]
Failed tests:
<ul>
[% FOREACH f IN test.results.failed %]
<li>
[% f %]
</li>
[% FOREACH f IN test.results.failed.keys %]
<li><a
href=
"javascript:togglecontent('logs_[% test.name %]_[% f %]');"
>
[% f %]
</a>
<pre
id=
"logs_[% test.name %]_[% f %]"
style=
"display:none"
>
[% test.results.failed.$f %]
</pre>
</li>
[% END %]
</ul>
[% END %]
...
...
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