TorBrowserBuild.pm 3.89 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 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123

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 => [
                'nightly',
                'torbrowser-linux-x86_64',
                'noversiondir',
            ],
            publish_dir => 'nightly-linux-x86_64',
        },
        {
            name  => 'nightly-linux-i686',
            descr => 'build tor-browser nightly linux-i686',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'nightly',
                'torbrowser-linux-i686',
                'noversiondir',
            ],
            publish_dir => 'nightly-linux-i686',
        },
        {
            name  => 'nightly-windows-i686',
            descr => 'build tor-browser nightly windows-i686',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'nightly',
                'torbrowser-windows-i686',
                'noversiondir',
            ],
            publish_dir => 'nightly-windows-i686',
        },
        {
            name  => 'nightly-osx-x86_64',
            descr => 'build tor-browser nightly osx-x86_64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'nightly',
                'torbrowser-osx-x86_64',
                'noversiondir',
            ],
            publish_dir => 'nightly-osx-x86_64',
        },

        # Alpha
        {
            name  => 'alpha-linux-x86_64',
            descr => 'build tor-browser alpha linux-x86_64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'alpha',
                'torbrowser-linux-x86_64',
                'noversiondir',
            ],
            publish_dir => 'alpha-linux-x86_64',
        },
        {
            name  => 'alpha-linux-i686',
            descr => 'build tor-browser alpha linux-i686',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'alpha',
                'torbrowser-linux-i686',
                'noversiondir',
            ],
            publish_dir => 'alpha-linux-i686',
        },
        {
            name  => 'alpha-windows-i686',
            descr => 'build tor-browser alpha windows-i686',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'alpha',
                'torbrowser-windows-i686',
                'noversiondir',
            ],
            publish_dir => 'alpha-windows-i686',
        },
        {
            name  => 'alpha-osx-x86_64',
            descr => 'build tor-browser alpha osx-x86_64',
            type  => 'rbm_build',
            project => 'release',
            targets => [
                'alpha',
                'torbrowser-osx-x86_64',
                'noversiondir',
            ],
            publish_dir => 'alpha-osx-x86_64',
        },
    ];
}

sub pre_tests {
    my ($tbbinfos) = @_;
124
    $ENV{RBM_LOGS_DIR} = "$tbbinfos->{publish_dir}/logs";
125 126
    my $gr = TBBTestSuite::GitRepo->new({
            name => 'tor-browser-build',
127
            git_url => 'https://git.torproject.org/builders/tor-browser-build.git',
128 129
        });
    $gr->clone_fetch;
130
    $gr->cmd('git', 'checkout', 'master');
131
    chdir $gr->clone_dir();
132 133
    copy($tbbinfos->{rbm_local_conf}, $gr->clone_dir() . '/rbm.local.conf')
            if $tbbinfos->{rbm_local_conf};
134 135 136 137 138
    system('make', 'submodule-update');
    system('make', 'fetch');
}

1;