Subject: | Tests fail when installing the module. |
Message body is not shown because it is too large.
Subject: | test.pl |
#!/usr/bin/perl -w
# test suite
use strict;
use Test::Simple tests => 7;
use X11::SendEvent;
ok(1, 'use X11::SendEvent');
my $cmd = "xev";
my $count = 0;
for (split /:/, $ENV{PATH}) {
$count++ if -x "$_/$cmd";
}
ok($count, "finding $cmd");
exit unless $count;
my $pid = open(cmd, "$cmd &|") || die $!;
ok(1, "$cmd running");
sleep 1;
my $win = X11::SendEvent->new(win => ["Event Tester"], debug => $ENV{DEBUG});
ok(defined $win && $win->isa('X11::SendEvent'), "component instantiated");
$win->SendString(["Return"]) for 1 .. 4;
ok(1, "string sent");
while (<cmd>) {
print if $ENV{DEBUG};
ok(1, "event received"), last if /Return/;
}
close(cmd);
ok(1, "done");