sub import {
my $class = shift;
my $pkg = caller;
- eval "package $pkg;
-use Test::Most" . (@_ > 0 ? " qw(@_)" : "") . ";
+
+ my $test_most_args = @_ ? "qw(@_)" : "";
+ local $@;
+ eval << "__";
+package $pkg;
+use Test::Most $test_most_args;
use Data::Dumper;
use AnyEvent::I3;
use Time::HiRes qw(sleep);
use Test::Deep qw(eq_deeply cmp_deeply cmp_set cmp_bag cmp_methods useclass noclass set bag subbagof superbagof subsetof supersetof superhashof subhashof bool str arraylength Isa ignore methods regexprefonly regexpmatches num regexponly scalref reftype hashkeysonly blessed array re hash regexpref hash_each shallow array_each code arrayelementsonly arraylengthonly scalarrefonly listmethods any hashkeys isa);
-use v5.10;
-use strict;
-use warnings;
-";
+__
+ $tester->bail_out("$@") if $@;
+ feature->import(":5.10");
+ strict->import;
+ warnings->import;
+
@_ = ($class);
goto \&Exporter::import;
}
$tmp_socket_path = File::Temp::tempnam('/tmp', 'i3-test-socket-');
}
- my ($fh, $tmpfile) = tempfile('i3-test-config-XXXXX', UNLINK => 1);
+ my ($fh, $tmpfile) = tempfile('/tmp/i3-test-config-XXXXX', UNLINK => 1);
say $fh $config;
say $fh "ipc-socket $tmp_socket_path" unless $dont_add_socket_path;
close($fh);
display => $ENV{DISPLAY},
configfile => $tmpfile,
outdir => $ENV{OUTDIR},
- logpath => $ENV{LOGPATH},
+ testname => $ENV{TESTNAME},
+ valgrind => $ENV{VALGRIND},
+ strace => $ENV{STRACE},
cv => $cv,
);
return $pid;
}
+package i3test::X11;
+use parent 'X11::XCB::Connection';
+
+sub input_focus {
+ my $self = shift;
+ i3test::sync_with_i3($self);
+
+ return $self->SUPER::input_focus(@_);
+}
+
1