GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

TorBrowserBuild.pm 4.56 KB
Newer Older
1 2 3 4 5 6
package TBBTestSuite::TestSuite::TorBrowserBuild;

use strict;
use parent 'TBBTestSuite::TestSuite::RBMBuild';

use TBBTestSuite::GitRepo;
7
use File::Copy;
8
use IO::CaptureOutput qw(capture_exec);
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

sub description {
    'Tor Browser Build';
}

sub type {
    'tor-browser_build';
};

sub set_tests {
    my ($testsuite) = @_;
    $testsuite->{tests} = [
        # Nightly
        {
            name  => 'nightly-linux-x86_64',
            descr => 'build tor-browser nightly linux-x86_64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
28
                'noversiondir',
29 30 31 32 33 34 35 36 37 38 39
                'nightly',
                'torbrowser-linux-x86_64',
            ],
            publish_dir => 'nightly-linux-x86_64',
        },
        {
            name  => 'nightly-linux-i686',
            descr => 'build tor-browser nightly linux-i686',
            type  => 'rbm_build',
            project => 'release',
            targets => [
40
                'noversiondir',
41 42 43 44 45 46 47 48 49 50 51
                'nightly',
                'torbrowser-linux-i686',
            ],
            publish_dir => 'nightly-linux-i686',
        },
        {
            name  => 'nightly-windows-i686',
            descr => 'build tor-browser nightly windows-i686',
            type  => 'rbm_build',
            project => 'release',
            targets => [
52
                'noversiondir',
53 54 55 56 57
                'nightly',
                'torbrowser-windows-i686',
            ],
            publish_dir => 'nightly-windows-i686',
        },
58 59 60 61 62 63 64 65 66 67 68 69
        {
            name  => 'nightly-windows-x86_64',
            descr => 'build tor-browser nightly windows-x86_64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'noversiondir',
                'nightly',
                'torbrowser-windows-x86_64',
            ],
            publish_dir => 'nightly-windows-x86_64',
        },
70 71 72 73 74 75
        {
            name  => 'nightly-osx-x86_64',
            descr => 'build tor-browser nightly osx-x86_64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
76
                'noversiondir',
77 78 79 80 81
                'nightly',
                'torbrowser-osx-x86_64',
            ],
            publish_dir => 'nightly-osx-x86_64',
        },
82 83 84 85 86 87 88 89 90 91 92 93
        {
            name  => 'nightly-android-armv7',
            descr => 'build tor-browser nightly android-armv7',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'noversiondir',
                'nightly',
                'torbrowser-android-armv7',
            ],
            publish_dir => 'nightly-android-armv7',
        },
94 95 96 97 98 99 100 101 102 103 104 105
        {
            name  => 'nightly-android-x86',
            descr => 'build tor-browser nightly android-x86',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'noversiondir',
                'nightly',
                'torbrowser-android-x86',
            ],
            publish_dir => 'nightly-android-x86',
        },
boklm's avatar
boklm committed
106 107 108 109 110 111 112 113 114 115 116 117
        {
            name  => 'nightly-android-x86_64',
            descr => 'build tor-browser nightly android-x86_64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'noversiondir',
                'nightly',
                'torbrowser-android-x86_64',
            ],
            publish_dir => 'nightly-android-x86_64',
        },
118 119 120 121 122 123 124 125 126 127 128 129
        {
            name  => 'nightly-android-aarch64',
            descr => 'build tor-browser nightly android-aarch64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'noversiondir',
                'nightly',
                'torbrowser-android-aarch64',
            ],
            publish_dir => 'nightly-android-aarch64',
        },
130 131 132 133 134 135 136
    ];
}

sub pre_tests {
    my ($tbbinfos) = @_;
    my $gr = TBBTestSuite::GitRepo->new({
            name => 'tor-browser-build',
137
            git_url => 'https://git.torproject.org/builders/tor-browser-build.git',
138 139
        });
    $gr->clone_fetch;
140
    $gr->cmd('git', 'checkout', 'master');
141
    chdir $gr->clone_dir();
142 143
    copy($tbbinfos->{rbm_local_conf}, $gr->clone_dir() . '/rbm.local.conf')
            if $tbbinfos->{rbm_local_conf};
144 145 146 147 148 149 150 151
    my @clean = ('clean') if $tbbinfos->{make_clean};
    foreach my $cmd (('submodule-update', 'fetch', @clean)) {
        my ($out, $err, $success) = capture_exec('make', $cmd);
        if (!$success) {
            $tbbinfos->{pre_tests_error} = "Error running make $cmd:\n$out\n$err";
            return;
        }
    }
152 153 154
}

1;