diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-16 19:40:50 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-16 19:40:50 +0200 |
commit | f71e24c8abfc484a8e905c3271b136ab754f2e0b (patch) | |
tree | d34851811909cf1ba8ecf82e5c4fad0e30b91d61 | |
parent | 3e1f8197e4c0b2cf1603b4762fb309e5e35cfc8a (diff) |
Run X tests in Xnest. Kinda buggy so far, but still better than before
-rw-r--r-- | Makefile | 10 | ||||
-rwxr-xr-x | test/feh.i | 8 | ||||
-rwxr-xr-x | test/run-interactive | 8 |
3 files changed, 16 insertions, 10 deletions
@@ -7,15 +7,7 @@ test: all @PACKAGE=${PACKAGE} VERSION=${VERSION} prove test test-interactive: all - @if [ "$$(whoami)" != derf ]; then \ - echo "Note: This will do stuff with your X and take a while"; \ - echo "If you don't know what's going on, hit ^C now"; \ - sleep 5; \ - echo "Okay, running test"; \ - fi - @if [ "$$(whoami)" = derf ]; then setxkbmap us; fi - @prove test/*.i - @if [ "$$(whoami)" = derf ]; then setxkbmap greedy; fi + @test/run-interactive install: install-man install-doc install-bin install-font install-img @@ -7,8 +7,9 @@ use Test::More tests => 30; use X11::GUITest qw/ FindWindowLike GetWindowName - StartApp + SetInputFocus SendKeys + StartApp WaitWindowViewable /; @@ -28,6 +29,10 @@ sub feh_start { BAIL_OUT("Unable to start feh ${opts} ${files}"); } + if (not SetInputFocus($id)) { + BAIL_OUT("Unable to focus window"); + } + return $id; } @@ -126,6 +131,7 @@ $win = feh_start('--cycle-once --slideshow-delay -0.01', sleep(0.1); test_win_title($win, 'feh [1 of 3] - test/ok.png'); SendKeys('h'); +sleep(1); test_no_win('cycle-once + negative delay + [h]'); $win = feh_start(q{}, 'test/ok.png test/ok.gif test/ok.gif test/ok.jpg'); diff --git a/test/run-interactive b/test/run-interactive new file mode 100755 index 0000000..d86c09c --- /dev/null +++ b/test/run-interactive @@ -0,0 +1,8 @@ +#!/bin/sh + +Xnest :1 & +pid=${!} + +DISPLAY=:1 prove test/feh.i + +kill ${pid} |