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.

Unverified Commit 606d496a authored by boklm's avatar boklm

ADd the --enable-tests options

An option to only run some selected tests.
parent 6bef27cc
......@@ -110,6 +110,12 @@ Available options
When using xvfb, this sets the default resolution. The default
is 1024x768.
--enable-tests=<test1,test2>
Only run the list of tests selected. When this option is not
used, all tests are run. This option is useful when you are
working on a new test and don't want to run all the test suite
to try your new test.
Configuration Files
-------------------
......
......@@ -38,7 +38,7 @@ sub get_options {
my @options = qw(mozmill! selenium! starttor! tor-control-port=i
tor-socks-port=i reports-dir=s gpgcheck! keyring=s
virtualenv=s xvfb! name=s download-dir=s config=s
action=s);
action=s enable-tests=s);
my (%cli, %config);
Getopt::Long::GetOptionsFromArray(\@_, \%cli, @options) || exit 1;
$cli{args} = \@_ if @_;
......
......@@ -26,10 +26,11 @@ my %test_types = (
our @tests = (
{
name => 'tor_bootstrap',
type => 'tor_bootstrap',
descr => 'Check that we can bootstrap tor',
fatal => 1,
name => 'tor_bootstrap',
type => 'tor_bootstrap',
descr => 'Check that we can bootstrap tor',
fatal => 1,
always => 1,
},
{
name => 'check_screenshot',
......@@ -220,7 +221,13 @@ sub selenium_run {
sub run_tests {
my ($tbbinfos) = @_;
my @enable_tests = $options->{'enable-tests'}
? split(',', $options->{'enable-tests'}) : ();
foreach my $test (@{$tbbinfos->{tests}}) {
if (@enable_tests && !$test->{always}
&& ! grep { $test->{name} eq $_ } @enable_tests) {
next;
}
$test_types{$test->{type}}->($tbbinfos, $test)
if $test_types{$test->{type}};
if ($test->{fatal} && $test->{results} &&
......
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