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

Do sha256sums.txt filtering in testsuite constructor

parent f5a9f961
......@@ -14,6 +14,7 @@ sub type {
sub new {
my ($ts, $testsuite) = @_;
return undef unless $testsuite->{os} ne 'MacOSX';
$testsuite->{type} = $ts->type();
$testsuite->{tests} = [
{
......
......@@ -618,6 +618,8 @@ sub new {
my ($ts, $testsuite) = @_;
$testsuite->{type} = 'browserbundle';
$testsuite->{tests} = [ map { { %$_ } } @tests ];
return undef unless $testsuite->{os} eq $options->{os};
return undef unless $testsuite->{arch} eq $options->{arch};
return bless $testsuite, $ts;
}
......
......@@ -12,6 +12,7 @@ sub type {
sub new {
my ($ts, $testsuite) = @_;
return undef unless $testsuite->{os} eq 'Windows';
$testsuite->{type} = 'browserbundle_virustotal';
$testsuite->{tests} = [
{
......
......@@ -152,12 +152,6 @@ sub tbb_filename_infos {
: TBBTestSuite::TestSuite::BrowserBundleTests->new(\%res);
}
sub matching_tbbfile {
my $o = tbb_filename_infos($_[0]);
return $o && $o->{os} eq $options->{os} && $o->{arch} eq $options->{arch};
}
sub check_gpgsig {
my ($file) = @_;
my @kr_args;
......@@ -196,10 +190,11 @@ sub test_sha {
}
my (undef, $dir) = File::Spec->splitpath($shafile);
my @files = map { [ reverse split / /, $_ ] } split /\n/, $content;
@files = grep { matching_tbbfile($_->[0]) } @files;
foreach my $file (@files) {
my $tbbinfos = tbb_filename_infos("$dir/$file->[0]");
next unless $tbbinfos;
$tbbinfos->{sha256sum} = $file->[1];
print "Running tests on $file->[0]\n";
test_start($report, $tbbinfos);
}
}
......
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