Unverified Commit 133d9986 authored by boklm's avatar boklm
Browse files

Start an X server and window manager

Add an --no-xdummy option to avoid doing this.

We are now starting an X server with the dummy driver, and a window
manager, to run the tests, instead of xvfb.

Some mochitests are failing when they are running inside xvfb instead of
a real window manager.
parent f1680e5d
......@@ -17,6 +17,7 @@ use TBBTestSuite::Options qw($options);
use TBBTestSuite::Tests::VirusTotal qw(virustotal_run);
use TBBTestSuite::Tests::Command qw(command_run);
use TBBTestSuite::Tests::TorBootstrap;
use TBBTestSuite::XServer qw(start_X stop_X set_Xmode);
our (@ISA, @EXPORT_OK);
BEGIN {
......@@ -482,11 +483,16 @@ sub pre_tests {
set_tbbpaths($tbbinfos);
chdir $tbbinfos->{tbbdir} || exit_error "Can't enter directory $tbbinfos->{tbbdir}";
$ENV{TOR_SKIP_LAUNCH} = 1;
if ($options->{xdummy}) {
$tbbinfos->{Xdisplay} = start_X("$tbbinfos->{'results-dir'}/xorg.log");
set_Xmode($tbbinfos->{Xdisplay}, $options->{resolution});
}
}
sub post_tests {
my ($tbbinfos) = @_;
TBBTestSuite::Tests::TorBootstrap::stop_tor($tbbinfos);
stop_X($tbbinfos->{Xdisplay}) if $options->{xdummy};
}
1;
......@@ -12,6 +12,7 @@ use JSON;
use TBBTestSuite::Common qw(exit_error get_nbcpu run_to_file);
use TBBTestSuite::Reports qw(load_report);
use TBBTestSuite::Options qw($options);
use TBBTestSuite::XServer qw(start_X stop_X set_Xmode);
my $test_types = {
xpcshell => \&xpcshell_test,
......@@ -75,9 +76,15 @@ sub pre_tests {
my ($config_guess) = capture_exec('./build/autoconf/config.guess');
chomp $config_guess;
$tbbinfos->{topobjdir} = "obj-$config_guess";
if ($options->{xdummy}) {
$tbbinfos->{Xdisplay} = start_X("$tbbinfos->{'results-dir'}/xorg.log");
set_Xmode($tbbinfos->{Xdisplay}, $options->{resolution});
}
}
sub post_tests {
my ($tbbinfos) = @_;
stop_X($tbbinfos->{Xdisplay}) if $options->{xdummy};
}
sub tests_by_name {
......
......@@ -32,7 +32,8 @@ my %default_options = (
'reports-dir' => "$FindBin::Bin/reports",
virtualenv => "$FindBin::Bin/virtualenv",
resolution => '1024x768',
xvfb => $OSNAME ne 'cygwin',
xvfb => 0,
xdummy => $OSNAME ne 'cygwin',
mbox => has_bin('mbox'),
virustotal => 0,
newlayout => 1,
......@@ -52,7 +53,7 @@ sub get_options {
action=s enable-tests=s upload-to=s os=s arch=s
virustotal! email-to=s@ email-from=s email-subject=s
mozmill-dir=s reports-url=s http-proxy-port=i
newlayout! mbox!);
newlayout! mbox! xdummy!);
my (%cli, %config);
Getopt::Long::GetOptionsFromArray(\@_, \%cli, @options) || exit 1;
$cli{args} = \@_ if @_;
......
......@@ -14,6 +14,7 @@ use TBBTestSuite::Common qw(exit_error);
use TBBTestSuite::Options qw($options);
use TBBTestSuite::BrowserBundleTests qw(tbb_filename_infos);
use TBBTestSuite::BrowserUnitTests;
use TBBTestSuite::XServer qw(set_Xmode);
our %testsuite_types = (
browserunit => \%TBBTestSuite::BrowserUnitTests::testsuite,
......@@ -39,10 +40,16 @@ sub run_tests {
print "* Running test $test->{name} *\n";
print '*' x (17 + length($test->{name})), "\n\n";
$test->{start_time} = time;
if ($options->{xdummy} && $test->{resolution}) {
set_Xmode($tbbinfos->{Xdisplay}, $test->{resolution});
}
$test->{pre}->($tbbinfos, $test) if $test->{pre};
$test_types->{$test->{type}}->($tbbinfos, $test)
if $test_types->{$test->{type}};
$test->{post}->($tbbinfos, $test) if $test->{post};
if ($options->{xdummy} && $test->{resolution}) {
set_Xmode($tbbinfos->{Xdisplay}, $options->{resolution});
}
$test->{finish_time} = time;
$test->{run_time} = $test->{finish_time} - $test->{start_time};
if ($test->{fail_type} eq 'fatal' && is_test_error($test)) {
......
......@@ -5,7 +5,7 @@ This git repository is using git submodules. So before running the test
suite, you will need to run 'git submodule init' and 'git submodule update'.
To run the test suite, you need perl and a few perl modules, python
virtualenv, and xvfb.
virtualenv, and xvfb or the Xorg dummy driver.
Those dependencies can be installed by running the 'install-deps' script
as root, which will install the needed packages. This script has been
......@@ -19,6 +19,6 @@ Summary of installation instructions:
$ git submodule init
$ git submodule update
$ sudo ./install-deps
$ sudo ./install-deps X
$ ./setup-virtualenv
......@@ -83,12 +83,16 @@ Available options
The default is the 'virtualenv' directory created by the
'setup-virtualenv' script.
--no-xvfb::
Don't run the tests using a virtual frame buffer X server.
--xvfb::
Run the tests using a virtual frame buffer X server. You should
also disable the X server with --no-xdummy.
--no-xdummy::
Don't start an X server with the dummy driver to run the tests.
--resolution=<resolution>::
When using xvfb, this sets the default resolution. The default
is 1024x768.
When using xvfb or X dummy, 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
......
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