testcases: let i3test.pm export $x, adapt testcases

This commit is contained in:
Maik Fischer
2011-11-21 21:39:50 +01:00
committed by Michael Stapelberg
parent 1b1d7941ec
commit 30ea33decb
52 changed files with 15 additions and 239 deletions

View File

@ -39,6 +39,7 @@ our @EXPORT = qw(
wait_for_event
wait_for_map
wait_for_unmap
$x
);
my $tester = Test::Builder->new();
@ -46,6 +47,8 @@ my $_cached_socket_path = undef;
my $_sync_window = undef;
my $tmp_socket_path = undef;
our $x;
BEGIN {
my $window_count = 0;
sub counter_window {
@ -72,6 +75,7 @@ __
strict->import;
warnings->import;
$x ||= i3test::X11->new;
@_ = ($class);
goto \&Exporter::import;
}
@ -404,7 +408,6 @@ sub get_socket_path {
return $_cached_socket_path;
}
my $x = X11::XCB::Connection->new;
my $atom = $x->atom(name => 'I3_SOCKET_PATH');
my $cookie = $x->get_property(0, $x->get_root_window(), $atom->id, GET_PROPERTY_TYPE_ANY, 0, 256);
my $reply = $x->get_property_reply($cookie->{sequence});