summaryrefslogtreecommitdiff
path: root/test/feh-bg.i
diff options
context:
space:
mode:
Diffstat (limited to 'test/feh-bg.i')
-rwxr-xr-xtest/feh-bg.i22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/feh-bg.i b/test/feh-bg.i
index 1cfb43f..eeff836 100755
--- a/test/feh-bg.i
+++ b/test/feh-bg.i
@@ -2,11 +2,14 @@
use strict;
use warnings;
use 5.010;
+use autodie qw/:all/;
use GD qw/:DEFAULT :cmp/;
use Test::More tests => 70;
use Time::HiRes qw/sleep/;
+my ($pid_xnest, $pid_twm);
+
sub set_bg {
my ($mode, $file) = @_;
@@ -36,6 +39,20 @@ sub check_bg {
);
}
+if (($pid_xnest = fork()) == 0) {
+ exec(qw( Xnest -geometry 500x500 :7 ));
+}
+
+sleep(0.5);
+
+$ENV{'DISPLAY'} = ':7';
+
+if (($pid_twm = fork()) == 0) {
+ exec('twm');
+}
+
+sleep(0.5);
+
for my $mode (qw( center fill max scale tile )) {
set_bg($mode, 'exact/in');
@@ -51,4 +68,9 @@ for my $mode (qw( center fill max scale tile )) {
}
}
+kill(15, $pid_twm);
+sleep(0.2);
+kill(15, $pid_xnest);
+sleep(0.2);
+
unlink("/tmp/feh_${$}.png");