tests: complete_run: directly use X11::XCB instead of ::Connection

This saves about 0.5s wallclock time due to not starting up Moose/Mouse.
This is worthwhile when you develop a new feature and you are often invoking
complete_run for one specific test.
This commit is contained in:
Michael Stapelberg 2011-09-24 13:09:20 +01:00
parent 4da5b7e784
commit e244a75801
1 changed files with 7 additions and 6 deletions

View File

@ -28,7 +28,7 @@ use AnyEvent::I3 qw(:all);
use Try::Tiny; use Try::Tiny;
use Getopt::Long; use Getopt::Long;
use Time::HiRes qw(sleep); use Time::HiRes qw(sleep);
use X11::XCB::Connection; use X11::XCB;
use IO::Socket::UNIX; # core use IO::Socket::UNIX; # core
use POSIX; # core use POSIX; # core
use AnyEvent::Handle; use AnyEvent::Handle;
@ -75,13 +75,14 @@ my $result = GetOptions(
my @conns; my @conns;
my @wdisplays; my @wdisplays;
for my $display (@displays) { for my $display (@displays) {
try { my $screen;
my $x = X11::XCB::Connection->new(display => $display); my $x = X11::XCB->new($display, $screen);
if ($x->has_error) {
say STDERR "WARNING: Not using X11 display $display, could not connect";
} else {
push @conns, $x; push @conns, $x;
push @wdisplays, $display; push @wdisplays, $display;
} catch { }
say STDERR "WARNING: Not using X11 display $display, could not connect";
};
} }
my $config = slurp('i3-test.config'); my $config = slurp('i3-test.config');