summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/feh-scr.i67
-rw-r--r--test/scr/caption_donebin0 -> 9669 bytes
-rw-r--r--test/scr/caption_newbin0 -> 19333 bytes
-rw-r--r--test/scr/caption_nonebin0 -> 6525 bytes
-rw-r--r--test/scr/caption_whilebin0 -> 21458 bytes
5 files changed, 52 insertions, 15 deletions
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
--- /dev/null
+++ b/test/scr/caption_done
Binary files differ
diff --git a/test/scr/caption_new b/test/scr/caption_new
new file mode 100644
index 0000000..fc438fd
--- /dev/null
+++ b/test/scr/caption_new
Binary files differ
diff --git a/test/scr/caption_none b/test/scr/caption_none
new file mode 100644
index 0000000..5903c34
--- /dev/null
+++ b/test/scr/caption_none
Binary files differ
diff --git a/test/scr/caption_while b/test/scr/caption_while
new file mode 100644
index 0000000..e9db559
--- /dev/null
+++ b/test/scr/caption_while
Binary files differ