diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/feh-scr.i | 59 | ||||
-rw-r--r-- | test/scr/feh_lhi | bin | 0 -> 13552 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_i | bin | 0 -> 34338 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_ii | bin | 0 -> 71938 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_iir | bin | 0 -> 15536 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_iirr | bin | 0 -> 15431 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_iirri | bin | 0 -> 64012 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_iirrio | bin | 0 -> 72552 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_o | bin | 0 -> 120797 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_oo | bin | 0 -> 131624 bytes | |||
-rw-r--r-- | test/scr/feh_lhi_ooo | bin | 0 -> 141170 bytes |
11 files changed, 54 insertions, 5 deletions
diff --git a/test/feh-scr.i b/test/feh-scr.i index 05960a2..5067ba7 100755 --- a/test/feh-scr.i +++ b/test/feh-scr.i @@ -6,7 +6,7 @@ use autodie qw/:all/; use Cwd; use GD qw/:DEFAULT :cmp/; -use Test::More tests => 27; +use Test::More tests => 38; use Time::HiRes qw/sleep/; use X11::GUITest qw/:ALL/; @@ -14,6 +14,7 @@ my ($pid_xnest, $pid_twm); my $win; my ($width, $height); my $pwd = getcwd(); +my $test_id = 0; sub waitfor(&) { my ($sub) = @_; @@ -62,6 +63,10 @@ sub same_files { my $img_one = GD::Image->new($one); my $img_two = GD::Image->new($two); + if (not defined $img_one or not defined $img_two) { + return 0; + } + return( ! ($img_one->compare($img_two) & GD_CMP_IMAGE)); } @@ -75,11 +80,17 @@ sub check_scr { sub test_scr { my ($file) = @_; + my $msg = "X root window is test/scr/${file}"; + + $test_id++; - ok( - waitfor { check_scr($file) }, - "X root window is test/scr/${file}", - ); + if (waitfor { check_scr($file) }) { + pass($msg); + } + else { + fail($msg); + rename("/tmp/feh_${$}.png", "/tmp/feh_${$}_${test_id}_${file}.png"); + } } if (FindWindowLike(qr{^feh})) { @@ -216,6 +227,44 @@ test_scr('draw_nothing'); feh_stop(); +feh_start(q{}, 'test/bg/large/h/in'); +test_scr('feh_lhi'); + +SendKeys('{UP}'); +test_scr('feh_lhi_i'); + +SendKeys('{UP}'); +test_scr('feh_lhi_ii'); + +SendKeys('^({RIG})'); +test_scr('feh_lhi_iir'); + +SendKeys('^({RIG})'); +test_scr('feh_lhi_iirr'); + +SendKeys('{UP}'); +test_scr('feh_lhi_iirri'); + +SendKeys('{DOW}'); +test_scr('feh_lhi_iirrio'); + +feh_stop(); + +feh_start(q{}, 'test/bg/large/h/in'); +test_scr('feh_lhi'); + +SendKeys('{DOW}'); +test_scr('feh_lhi_o'); + +SendKeys('{DOW}'); +test_scr('feh_lhi_oo'); + +SendKeys('{DOW}'); +test_scr('feh_lhi_ooo'); + +feh_stop(); + + unlink('test/bg/exact/.tc/in.txt'); rmdir('test/bg/exact/.tc'); unlink("/tmp/feh_${$}.png"); diff --git a/test/scr/feh_lhi b/test/scr/feh_lhi Binary files differnew file mode 100644 index 0000000..f16d150 --- /dev/null +++ b/test/scr/feh_lhi diff --git a/test/scr/feh_lhi_i b/test/scr/feh_lhi_i Binary files differnew file mode 100644 index 0000000..108dfb6 --- /dev/null +++ b/test/scr/feh_lhi_i diff --git a/test/scr/feh_lhi_ii b/test/scr/feh_lhi_ii Binary files differnew file mode 100644 index 0000000..1fb695f --- /dev/null +++ b/test/scr/feh_lhi_ii diff --git a/test/scr/feh_lhi_iir b/test/scr/feh_lhi_iir Binary files differnew file mode 100644 index 0000000..396ee99 --- /dev/null +++ b/test/scr/feh_lhi_iir diff --git a/test/scr/feh_lhi_iirr b/test/scr/feh_lhi_iirr Binary files differnew file mode 100644 index 0000000..81748a3 --- /dev/null +++ b/test/scr/feh_lhi_iirr diff --git a/test/scr/feh_lhi_iirri b/test/scr/feh_lhi_iirri Binary files differnew file mode 100644 index 0000000..43b8fa1 --- /dev/null +++ b/test/scr/feh_lhi_iirri diff --git a/test/scr/feh_lhi_iirrio b/test/scr/feh_lhi_iirrio Binary files differnew file mode 100644 index 0000000..c9e287b --- /dev/null +++ b/test/scr/feh_lhi_iirrio diff --git a/test/scr/feh_lhi_o b/test/scr/feh_lhi_o Binary files differnew file mode 100644 index 0000000..ec48c01 --- /dev/null +++ b/test/scr/feh_lhi_o diff --git a/test/scr/feh_lhi_oo b/test/scr/feh_lhi_oo Binary files differnew file mode 100644 index 0000000..784d7d7 --- /dev/null +++ b/test/scr/feh_lhi_oo diff --git a/test/scr/feh_lhi_ooo b/test/scr/feh_lhi_ooo Binary files differnew file mode 100644 index 0000000..ad14384 --- /dev/null +++ b/test/scr/feh_lhi_ooo |