Skip to content
Snippets Groups Projects
Commit 9271b3c2 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Graphical --caption-path tests

parent 095bf053
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ use autodie qw/:all/; ...@@ -6,7 +6,7 @@ use autodie qw/:all/;
use Cwd; use Cwd;
use GD qw/:DEFAULT :cmp/; use GD qw/:DEFAULT :cmp/;
use Test::More tests => 11; use Test::More tests => 19;
use Time::HiRes qw/sleep/; use Time::HiRes qw/sleep/;
use X11::GUITest qw/:ALL/; use X11::GUITest qw/:ALL/;
...@@ -18,7 +18,7 @@ my $pwd = getcwd(); ...@@ -18,7 +18,7 @@ my $pwd = getcwd();
sub waitfor(&) { sub waitfor(&) {
my ($sub) = @_; my ($sub) = @_;
my $out; my $out;
for (1 .. 40) { for (1 .. 10) {
sleep(0.05); sleep(0.05);
$out = &{$sub}; $out = &{$sub};
if ($out) { if ($out) {
...@@ -70,9 +70,15 @@ sub check_scr { ...@@ -70,9 +70,15 @@ sub check_scr {
system("import -silent -window root /tmp/feh_${$}.png"); system("import -silent -window root /tmp/feh_${$}.png");
return same_files("test/scr/${file}", "/tmp/feh_${$}.png");
}
sub test_scr {
my ($file) = @_;
ok( ok(
same_files("test/scr/${file}", "/tmp/feh_${$}.png"), waitfor { check_scr($file) },
"X root window is test/scr/${file}" "X root window is test/scr/${file}",
); );
} }
...@@ -85,7 +91,7 @@ feh_start( ...@@ -85,7 +91,7 @@ feh_start(
. '--action quux --action5 baz --action8 "nrm \'%f\'"', . '--action quux --action5 baz --action8 "nrm \'%f\'"',
'test/bg/exact/in test/bg/large/w/in test/bg/large/h/in' '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_stop();
feh_start( feh_start(
...@@ -93,36 +99,36 @@ feh_start( ...@@ -93,36 +99,36 @@ feh_start(
. '--action quux --action5 baz --action8 "nrm \'%f\'"', . '--action quux --action5 baz --action8 "nrm \'%f\'"',
'test/bg/exact/in' 'test/bg/exact/in'
); );
check_scr('draw_all_one'); test_scr('draw_all_one');
feh_stop(); feh_stop();
feh_start( feh_start(
'--fullscreen', '--fullscreen',
'test/bg/large/w/in' 'test/bg/large/w/in'
); );
check_scr('feh_full_lwi'); test_scr('feh_full_lwi');
feh_stop(); feh_stop();
feh_start( feh_start(
q{}, q{},
'test/bg/large/w/in' 'test/bg/large/w/in'
); );
check_scr('feh_lwi'); test_scr('feh_lwi');
SendKeys('^({RIG})'); SendKeys('^({RIG})');
check_scr('feh_lwi_scroll_r'); test_scr('feh_lwi_scroll_r');
SendKeys('^({DOW})'); SendKeys('^({DOW})');
check_scr('feh_lwi_scroll_rd'); test_scr('feh_lwi_scroll_rd');
SendKeys('^({RIG})'); SendKeys('^({RIG})');
check_scr('feh_lwi_scroll_rdr'); test_scr('feh_lwi_scroll_rdr');
SendKeys('^({UP})'); SendKeys('^({UP})');
check_scr('feh_lwi_scroll_rdru'); test_scr('feh_lwi_scroll_rdru');
SendKeys('^({LEF})'); SendKeys('^({LEF})');
check_scr('feh_lwi_scroll_rdrul'); test_scr('feh_lwi_scroll_rdrul');
feh_stop(); feh_stop();
...@@ -130,14 +136,45 @@ feh_start( ...@@ -130,14 +136,45 @@ feh_start(
'--scale-down', '--scale-down',
'test/bg/large/w/in' 'test/bg/large/w/in'
); );
check_scr('feh_scaledown_lwi'); test_scr('feh_scaledown_lwi');
feh_stop(); feh_stop();
feh_start( feh_start(
'--thumbnails', '--thumbnails',
'test/ok/gif test/ok/jpg test/ok/png test/ok/pnm' '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(); feh_stop();
unlink('test/bg/exact/.tc/in.txt');
rmdir('test/bg/exact/.tc');
unlink("/tmp/feh_${$}.png"); unlink("/tmp/feh_${$}.png");
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment