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
0291fd39
Unverified
Commit
0291fd39
authored
Sep 22, 2014
by
boklm
Browse files
Move the test for sha256sums.txt file outside tbb_filename_infos
parent
57cf4836
Changes
3
Hide whitespace changes
Inline
Side-by-side
TBBTestSuite/BrowserBundleTests.pm
View file @
0291fd39
...
@@ -297,8 +297,6 @@ sub tbb_filename_infos {
...
@@ -297,8 +297,6 @@ sub tbb_filename_infos {
}
elsif
(
$file
=~
m/^TorBrowserBundle-(.+)-osx32_(.+)\.zip$/
)
{
}
elsif
(
$file
=~
m/^TorBrowserBundle-(.+)-osx32_(.+)\.zip$/
)
{
@res
{
qw(type os arch version language)
}
=
@res
{
qw(type os arch version language)
}
=
('
browserbundle
',
'
MacOSX
',
'
x86
',
$
1
,
$
2
);
('
browserbundle
',
'
MacOSX
',
'
x86
',
$
1
,
$
2
);
}
elsif
(
$file
eq
'
sha256sums.txt
')
{
$res
{
type
}
=
'
sha256sum
';
}
else
{
}
else
{
$res
{
type
}
=
'
Unknown
';
$res
{
type
}
=
'
Unknown
';
}
}
...
...
TBBTestSuite/Tests.pm
View file @
0291fd39
...
@@ -169,8 +169,6 @@ sub test_sha {
...
@@ -169,8 +169,6 @@ sub test_sha {
sub
test_start
{
sub
test_start
{
my
(
$report
,
$tbbinfos
)
=
@_
;
my
(
$report
,
$tbbinfos
)
=
@_
;
my
$oldcwd
=
getcwd
;
my
$oldcwd
=
getcwd
;
return
test_sha
(
$report
,
$tbbinfos
->
{
tbbfile
})
if
$tbbinfos
->
{
type
}
eq
'
sha256sum
';
my
$tmpdir
=
File::Temp::
newdir
('
XXXXXX
',
DIR
=>
$options
->
{
tmpdir
});
my
$tmpdir
=
File::Temp::
newdir
('
XXXXXX
',
DIR
=>
$options
->
{
tmpdir
});
$tbbinfos
->
{
tmpdir
}
=
$tmpdir
->
dirname
;
$tbbinfos
->
{
tmpdir
}
=
$tmpdir
->
dirname
;
$tbbinfos
->
{
tests
}
//
=
[
map
{
{
%
$_
}
}
@
TBBTestSuite::BrowserBundleTests::
tests
];
$tbbinfos
->
{
tests
}
//
=
[
map
{
{
%
$_
}
}
@
TBBTestSuite::BrowserBundleTests::
tests
];
...
...
tbb-testsuite
View file @
0291fd39
...
@@ -4,6 +4,7 @@ use FindBin;
...
@@ -4,6 +4,7 @@ use FindBin;
use
lib
"
$FindBin
::Bin
";
use
lib
"
$FindBin
::Bin
";
use
Data::
Dump
qw/dd/
;
use
Data::
Dump
qw/dd/
;
use
File::
Path
qw(make_path)
;
use
File::
Path
qw(make_path)
;
use
File::
Spec
;
use
YAML::
Syck
;
use
YAML::
Syck
;
use
TBBTestSuite::
Common
qw(exit_error run_alone rm_pidfile)
;
use
TBBTestSuite::
Common
qw(exit_error run_alone rm_pidfile)
;
use
TBBTestSuite::
Options
qw($options)
;
use
TBBTestSuite::
Options
qw($options)
;
...
@@ -35,6 +36,13 @@ sub set_report_success {
...
@@ -35,6 +36,13 @@ sub set_report_success {
}
}
}
}
sub
is_shafile
{
my
(
$tbbfile
)
=
@_
;
return
0
if
ref
$tbbfile
;
my
(
undef
,
undef
,
$file
)
=
File::
Spec
->
splitpath
(
$tbbfile
);
return
$file
eq
'
sha256sums.txt
';
}
sub
run_tests
{
sub
run_tests
{
return
unless
@
{
$options
->
{
args
}};
return
unless
@
{
$options
->
{
args
}};
my
$report
=
{
my
$report
=
{
...
@@ -47,7 +55,11 @@ sub run_tests {
...
@@ -47,7 +55,11 @@ sub run_tests {
foreach
my
$tbbfile
(
@
{
$options
->
{
args
}})
{
foreach
my
$tbbfile
(
@
{
$options
->
{
args
}})
{
my
$tbbinfos
=
ref
$tbbfile
eq
'
HASH
'
?
$tbbfile
my
$tbbinfos
=
ref
$tbbfile
eq
'
HASH
'
?
$tbbfile
:
tbb_filename_infos
(
$tbbfile
);
:
tbb_filename_infos
(
$tbbfile
);
TBBTestSuite::Tests::
test_start
(
$report
,
$tbbinfos
);
if
(
is_shafile
(
$tbbfile
))
{
TBBTestSuite::Tests::
test_sha
(
$report
,
$tbbfile
);
}
else
{
TBBTestSuite::Tests::
test_start
(
$report
,
$tbbinfos
);
}
}
}
set_report_success
(
$report
);
set_report_success
(
$report
);
save_report
(
$report
);
save_report
(
$report
);
...
...
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