From 372b98d08e54bfe1dc7e6d1c9795b79f4c79b7c6 Mon Sep 17 00:00:00 2001 From: Maik Fischer Date: Tue, 22 Nov 2011 02:34:26 +0100 Subject: [PATCH] testcases: drop EV dependency --- testcases/Makefile.PL | 3 +-- testcases/lib/i3test.pm | 15 ++++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/testcases/Makefile.PL b/testcases/Makefile.PL index f82aa856..a7ed5047 100755 --- a/testcases/Makefile.PL +++ b/testcases/Makefile.PL @@ -10,8 +10,7 @@ WriteMakefile( 'AnyEvent' => 0, 'AnyEvent::I3' => '0.09', 'X11::XCB' => '0.03', - 'EV' => 0, - 'Inline' => 0, + 'Inline' => 0, }, PM => {}, # do not install any files from this directory clean => { diff --git a/testcases/lib/i3test.pm b/testcases/lib/i3test.pm index fb2b1cf5..0f2f2e07 100644 --- a/testcases/lib/i3test.pm +++ b/testcases/lib/i3test.pm @@ -8,7 +8,6 @@ use X11::XCB::Rect; use X11::XCB::Window; use X11::XCB qw(:all); use AnyEvent::I3; -use EV; use List::Util qw(first); use Time::HiRes qw(sleep); use Cwd qw(abs_path); @@ -94,11 +93,12 @@ sub wait_for_event { my $cv = AE::cv; - my $prep = EV::prepare sub { - $x->flush; - }; + $x->flush; - my $check = EV::check sub { + # unfortunately, there is no constant for this + my $ae_read = 0; + + my $guard = AE::io $x->get_file_descriptor, $ae_read, sub { while (defined(my $event = $x->poll_for_event)) { if ($cb->($event)) { $cv->send(1); @@ -107,15 +107,12 @@ sub wait_for_event { } }; - my $watcher = EV::io $x->get_file_descriptor, EV::READ, sub { - # do nothing, we only need this watcher so that EV picks up the events - }; - # Trigger timeout after $timeout seconds (can be fractional) my $t = AE::timer $timeout, 0, sub { warn "timeout ($timeout secs)"; $cv->send(0) }; my $result = $cv->recv; undef $t; + undef $guard; return $result; }