Commit fdb56cff authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Merge test/run-bg into test/feh-bg.i

Not possible for test/ren-interactive, unfortunately.
parent 0cb40fc2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -13,8 +13,7 @@ test: all

test-x11: all
	test/run-interactive
	sleep 3
	test/run-bg
	prove test/feh-bg.i

install: install-man install-doc install-bin install-font install-img

+22 −0
Original line number Diff line number Diff line
@@ -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");

test/run-bg

deleted100755 → 0
+0 −14
Original line number Diff line number Diff line
#!/bin/sh

Xnest -geometry 500x500 :7 > /dev/null 2>&1 &
pid=${!}

# Wallpaper setting requires a window manager to work reliably
DISPLAY=:7 twm > /dev/null 2>&1 &

DISPLAY=:7 prove -v test/feh-bg.i
ret=${?}

kill ${pid}

exit ${ret}
+2 −0
Original line number Diff line number Diff line
@@ -8,4 +8,6 @@ ret=${?}

kill ${pid}

sleep 2

exit ${ret}