Unverified Commit 0291fd39 authored by boklm's avatar boklm
Browse files

Move the test for sha256sums.txt file outside tbb_filename_infos

parent 57cf4836
......@@ -297,8 +297,6 @@ sub tbb_filename_infos {
} elsif ($file =~ m/^TorBrowserBundle-(.+)-osx32_(.+)\.zip$/) {
@res{qw(type os arch version language)} =
('browserbundle', 'MacOSX', 'x86', $1, $2);
} elsif ($file eq 'sha256sums.txt') {
$res{type} = 'sha256sum';
} else {
$res{type} = 'Unknown';
}
......
......@@ -169,8 +169,6 @@ sub test_sha {
sub test_start {
my ($report, $tbbinfos) = @_;
my $oldcwd = getcwd;
return test_sha($report, $tbbinfos->{tbbfile})
if $tbbinfos->{type} eq 'sha256sum';
my $tmpdir = File::Temp::newdir('XXXXXX', DIR => $options->{tmpdir});
$tbbinfos->{tmpdir} = $tmpdir->dirname;
$tbbinfos->{tests} //= [ map { { %$_ } } @TBBTestSuite::BrowserBundleTests::tests ];
......
......@@ -4,6 +4,7 @@ use FindBin;
use lib "$FindBin::Bin";
use Data::Dump qw/dd/;
use File::Path qw(make_path);
use File::Spec;
use YAML::Syck;
use TBBTestSuite::Common qw(exit_error run_alone rm_pidfile);
use TBBTestSuite::Options qw($options);
......@@ -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 {
return unless @{$options->{args}};
my $report = {
......@@ -47,7 +55,11 @@ sub run_tests {
foreach my $tbbfile (@{$options->{args}}) {
my $tbbinfos = ref $tbbfile eq 'HASH' ? $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);
save_report($report);
......
Markdown is supported
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