Skip to content
GitLab
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
8cf679ee
Unverified
Commit
8cf679ee
authored
Jul 23, 2014
by
boklm
Browse files
Move test_types, pre_tests, post_tests outside tbbinfos
parent
f6c5b484
Changes
3
Hide whitespace changes
Inline
Side-by-side
TBBTestSuite/BrowserBundleTests.pm
View file @
8cf679ee
...
...
@@ -47,6 +47,12 @@ my $test_types = {
command
=>
\
&command_run
,
};
our
%testsuite
=
(
test_types
=>
$test_types
,
pre_tests
=>
\
&pre_tests
,
post_tests
=>
\
&post_tests
,
);
our
@tests
=
(
{
name
=>
'
readelf_RELRO
',
...
...
@@ -273,8 +279,7 @@ sub tbb_filename_infos {
my
(
$tbbfile
)
=
@_
;
my
(
undef
,
undef
,
$file
)
=
File::
Spec
->
splitpath
(
$tbbfile
);
my
%res
=
(
filename
=>
$file
,
tbbfile
=>
$tbbfile
,
pre_tests
=>
\
&pre_tests
,
post_tests
=>
\
&post_tests
,
test_types
=>
$test_types
,
type
=>
'
browserbundle
');
type
=>
'
browserbundle
');
if
(
$file
=~
m/^tor-browser-linux(..)-([^_]+)_(.+)\.tar\.xz$/
)
{
@res
{
qw(type os version language)
}
=
('
tbbfile
',
'
Linux
',
$
2
,
$
3
);
$res
{
arch
}
=
$
1
eq
'
64
'
?
'
x86_64
'
:
'
x86
';
...
...
TBBTestSuite/BrowserUnitTests.pm
View file @
8cf679ee
...
...
@@ -13,15 +13,18 @@ my $test_types = {
build_firefox
=>
\
&build_firefox
,
};
our
%testsuite
=
(
test_types
=>
$test_types
,
pre_tests
=>
\
&pre_tests
,
post_tests
=>
\
&post_tests
,
);
sub
get_tbbinfos
{
my
(
$infos
)
=
@_
;
my
%tbbinfos
=
(
%$infos
,
pre_tests
=>
\
&pre_tests
,
post_tests
=>
\
&post_tests
,
type
=>
'
browserunit
',
filename
=>
"
browser-
$infos
->{commit}
",
test_types
=>
$test_types
,
tests
=>
[
{
name
=>
'
build_firefox
',
...
...
TBBTestSuite/Tests.pm
View file @
8cf679ee
...
...
@@ -13,12 +13,18 @@ use YAML;
use
TBBTestSuite::
Common
qw(exit_error)
;
use
TBBTestSuite::
Options
qw($options)
;
use
TBBTestSuite::
BrowserBundleTests
qw(tbb_filename_infos)
;
use
TBBTestSuite::
BrowserUnitTests
;
my
%testsuite_types
=
(
browserunit
=>
\
%
TBBTestSuite::BrowserUnitTests::
testsuite
,
browserbundle
=>
\
%
TBBTestSuite::BrowserBundleTests::
testsuite
,
);
sub
run_tests
{
my
(
$tbbinfos
)
=
@_
;
my
@enable_tests
=
$options
->
{'
enable-tests
'}
?
split
('
,
',
$options
->
{'
enable-tests
'})
:
();
my
$test_types
=
$t
bbinfos
->
{
test_types
};
my
$test_types
=
$t
estsuite_types
{
$tbbinfos
->
{
type
}}
->
{
test_types
};
foreach
my
$test
(
@
{
$tbbinfos
->
{
tests
}})
{
$test
->
{
fail_type
}
//
=
'
error
';
}
...
...
@@ -125,15 +131,13 @@ sub test_start {
$tbbinfos
->
{'
results-dir
'}
=
"
$options
->{'report-dir'}/results-
$tbbinfos
->{filename}
";
mkdir
$tbbinfos
->
{'
results-dir
'};
$tbbinfos
->
{
pre_tests
}(
$tbbinfos
)
;
delete
$tbbinfos
->
{
pre_tests
};
my
$testsuite
=
$testsuite_types
{
$tbbinfos
->
{
type
}}
;
$testsuite
->
{
pre_tests
}
(
$tbbinfos
)
;
$tbbinfos
->
{
start_time
}
=
time
;
run_tests
(
$tbbinfos
);
$tbbinfos
->
{
finish_time
}
=
time
;
$tbbinfos
->
{
run_time
}
=
$tbbinfos
->
{
finish_time
}
-
$tbbinfos
->
{
start_time
};
$tbbinfos
->
{
post_tests
}(
$tbbinfos
);
delete
$tbbinfos
->
{
post_tests
};
delete
$tbbinfos
->
{
test_types
};
$testsuite
->
{
post_tests
}(
$tbbinfos
);
chdir
$oldcwd
;
$tbbinfos
->
{
success
}
=
is_success
(
$tbbinfos
->
{
tests
});
$report
->
{
tbbfiles
}{
$tbbinfos
->
{
filename
}}
=
$tbbinfos
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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