From 9271b3c20aa50147e9c1f8e6e3ea0cc02acf8c18 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 4 Oct 2010 19:34:40 +0200 Subject: Graphical --caption-path tests --- test/feh-scr.i | 67 ++++++++++++++++++++++++++++++++++++++----------- test/scr/caption_done | Bin 0 -> 9669 bytes test/scr/caption_new | Bin 0 -> 19333 bytes test/scr/caption_none | Bin 0 -> 6525 bytes test/scr/caption_while | Bin 0 -> 21458 bytes 5 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 test/scr/caption_done create mode 100644 test/scr/caption_new create mode 100644 test/scr/caption_none create mode 100644 test/scr/caption_while (limited to 'test') diff --git a/test/feh-scr.i b/test/feh-scr.i index a67b511..dd7ece7 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 => 11; +use Test::More tests => 19; use Time::HiRes qw/sleep/; use X11::GUITest qw/:ALL/; @@ -18,7 +18,7 @@ my $pwd = getcwd(); sub waitfor(&) { my ($sub) = @_; my $out; - for (1 .. 40) { + for (1 .. 10) { sleep(0.05); $out = &{$sub}; if ($out) { @@ -70,9 +70,15 @@ sub check_scr { system("import -silent -window root /tmp/feh_${$}.png"); + return same_files("test/scr/${file}", "/tmp/feh_${$}.png"); +} + +sub test_scr { + my ($file) = @_; + ok( - same_files("test/scr/${file}", "/tmp/feh_${$}.png"), - "X root window is test/scr/${file}" + waitfor { check_scr($file) }, + "X root window is test/scr/${file}", ); } @@ -85,7 +91,7 @@ feh_start( . '--action quux --action5 baz --action8 "nrm \'%f\'"', 'test/bg/exact/in test/bg/large/w/in test/bg/large/h/in' ); -check_scr('draw_all_multi'); +test_scr('draw_all_multi'); feh_stop(); feh_start( @@ -93,36 +99,36 @@ feh_start( . '--action quux --action5 baz --action8 "nrm \'%f\'"', 'test/bg/exact/in' ); -check_scr('draw_all_one'); +test_scr('draw_all_one'); feh_stop(); feh_start( '--fullscreen', 'test/bg/large/w/in' ); -check_scr('feh_full_lwi'); +test_scr('feh_full_lwi'); feh_stop(); feh_start( q{}, 'test/bg/large/w/in' ); -check_scr('feh_lwi'); +test_scr('feh_lwi'); SendKeys('^({RIG})'); -check_scr('feh_lwi_scroll_r'); +test_scr('feh_lwi_scroll_r'); SendKeys('^({DOW})'); -check_scr('feh_lwi_scroll_rd'); +test_scr('feh_lwi_scroll_rd'); SendKeys('^({RIG})'); -check_scr('feh_lwi_scroll_rdr'); +test_scr('feh_lwi_scroll_rdr'); SendKeys('^({UP})'); -check_scr('feh_lwi_scroll_rdru'); +test_scr('feh_lwi_scroll_rdru'); SendKeys('^({LEF})'); -check_scr('feh_lwi_scroll_rdrul'); +test_scr('feh_lwi_scroll_rdrul'); feh_stop(); @@ -130,14 +136,45 @@ feh_start( '--scale-down', 'test/bg/large/w/in' ); -check_scr('feh_scaledown_lwi'); +test_scr('feh_scaledown_lwi'); feh_stop(); feh_start( '--thumbnails', 'test/ok/gif test/ok/jpg test/ok/png test/ok/pnm' ); -check_scr('thumbnail_default'); +test_scr('thumbnail_default'); +feh_stop(); + +feh_start( + '--caption-path .tc', + 'test/bg/exact/in' +); +test_scr('caption_none'); + +SendKeys('c'); +test_scr('caption_new'); + +SendKeys('Picknick im Zenit metaphysischen Wiederscheins der astralen Kuhglocke'); +test_scr('caption_while'); + +SendKeys('~'); +test_scr('caption_done'); + +SendKeys('c'); +test_scr('caption_while'); + +SendKeys('{BKS}' x 80); +test_scr('caption_new'); + +SendKeys('~'); +test_scr('caption_none'); + +SendKeys('cfoobar{ESC}'); +test_scr('caption_none'); + feh_stop(); +unlink('test/bg/exact/.tc/in.txt'); +rmdir('test/bg/exact/.tc'); unlink("/tmp/feh_${$}.png"); diff --git a/test/scr/caption_done b/test/scr/caption_done new file mode 100644 index 0000000..d178e7e Binary files /dev/null and b/test/scr/caption_done differ diff --git a/test/scr/caption_new b/test/scr/caption_new new file mode 100644 index 0000000..fc438fd Binary files /dev/null and b/test/scr/caption_new differ diff --git a/test/scr/caption_none b/test/scr/caption_none new file mode 100644 index 0000000..5903c34 Binary files /dev/null and b/test/scr/caption_none differ diff --git a/test/scr/caption_while b/test/scr/caption_while new file mode 100644 index 0000000..e9db559 Binary files /dev/null and b/test/scr/caption_while differ -- cgit v1.2.3