summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/feh-i.t12
-rw-r--r--test/feh.t36
-rw-r--r--test/list/custom8
-rw-r--r--test/list_imlib2_1.6/custom4
-rw-r--r--test/list_imlib2_1.6/default5
l---------test/list_imlib2_1.6/filename1
-rw-r--r--test/list_imlib2_1.6/filename_recursive7
l---------test/list_imlib2_1.6/format1
-rw-r--r--test/list_imlib2_1.6/format_reverse5
l---------test/list_imlib2_1.6/height1
l---------test/list_imlib2_1.6/name1
l---------test/list_imlib2_1.6/pixels1
-rw-r--r--test/list_imlib2_1.6/size5
l---------test/list_imlib2_1.6/width1
-rwxr-xr-xtest/mandoc.t19
-rw-r--r--test/nx_action/loadable_action8
-rw-r--r--test/nx_action/loadable_naction8
-rw-r--r--test/nx_action/unloadable_action8
-rw-r--r--test/nx_action/unloadable_naction8
-rw-r--r--test/status4
-rw-r--r--test/tiny.pbm4
21 files changed, 101 insertions, 46 deletions
diff --git a/test/feh-i.t b/test/feh-i.t
index ff247a2..24775e3 100755
--- a/test/feh-i.t
+++ b/test/feh-i.t
@@ -138,28 +138,28 @@ SendKeys('{RIG}');
test_win_title( $win, 'feh slideshow 2/3 jpg' );
feh_stop();
-feh_start( '--cycle-once', 'test/ok/png test/ok/jpg' );
+feh_start( '--on-last-slide=quit', 'test/ok/png test/ok/jpg' );
for ( 1 .. 2 ) {
SendKeys('{RIG}');
}
-test_no_win("--cycle-once -> window closed");
+test_no_win("--on-last-slide=quit -> window closed");
feh_start(
- '--cycle-once --slideshow-delay 0.5',
+ '--on-last-slide=quit --slideshow-delay 0.5',
'test/ok/png test/ok/jpg test/ok/gif'
);
sleep(1.5);
-test_no_win('cycle-once + slideshow-delay -> window closed');
+test_no_win('on-last-slide=quit + slideshow-delay -> window closed');
$win = feh_start(
- '--cycle-once --slideshow-delay -0.01',
+ '--on-last-slide=quit --slideshow-delay -0.01',
'test/ok/png test/ok/jpg test/ok/gif'
);
test_win_title( $win, 'feh [1 of 3] - test/ok/png [Paused]' );
SendKeys('h');
-test_no_win('cycle-once + negative delay + [h]');
+test_no_win('on-last-slide=quit + negative delay + [h]');
$win = feh_start( q{}, 'test/ok/png test/ok/gif test/ok/gif test/ok/jpg' );
for ( 1 .. 2 ) {
diff --git a/test/feh.t b/test/feh.t
index 47dfbc3..b9025b4 100644
--- a/test/feh.t
+++ b/test/feh.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
use 5.010;
-use Test::Command tests => 71;
+use Test::Command tests => 73;
$ENV{HOME} = 'test';
@@ -34,13 +34,23 @@ if ( length($feh_name) == 0 ) {
die($err_no_env);
}
+# Imlib2 1.6+ reports JPEG file format as 'jpg', older versions use 'jpeg'.
+# Determine the output format used in this version with a --customlist call.
+my $list_dir = 'list';
+if (qx{$feh --customlist %t test/ok/jpg} =~ m{jpg}) {
+ $list_dir = 'list_imlib2_1.6';
+}
+
my $version = qx{$feh --version};
if ( $version =~ m{ Compile-time \s switches : \s .* help }ox ) {
$has_help = 1;
}
+# Imlib2 1.8+ returns "Invalid image file" rather than "No Imlib2 loader".
+# feh compiled with magic=1 returns "Does not look like an image (magic bytes missing)"
+# Here, we accept all three.
my $re_warning
- = qr{${feh_name} WARNING: test/fail/... \- No Imlib2 loader for that file format\n};
+ = qr{${feh_name} WARNING: test/fail/... \- (Invalid image file|No Imlib2 loader for that file format|Does not look like an image \(magic bytes missing\))\n};
my $re_loadable = qr{test/ok/...};
my $re_unloadable = qr{test/fail/...};
my $re_list_action = qr{test/ok/... 16x16};
@@ -93,14 +103,14 @@ $cmd->stderr_is_eq('');
$cmd = Test::Command->new( cmd => "$feh --list $images" );
$cmd->exit_is_num(0);
-$cmd->stdout_is_file('test/list/default');
+$cmd->stdout_is_file("test/${list_dir}/default");
$cmd->stderr_like($re_warning);
for my $sort (qw/name filename width height pixels size format/) {
$cmd = Test::Command->new( cmd => "$feh --list $images --sort $sort" );
$cmd->exit_is_num(0);
- $cmd->stdout_is_file("test/list/$sort");
+ $cmd->stdout_is_file("test/${list_dir}/$sort");
$cmd->stderr_like($re_warning);
}
@@ -108,7 +118,7 @@ $cmd
= Test::Command->new( cmd => "$feh --list $images --sort format --reverse" );
$cmd->exit_is_num(0);
-$cmd->stdout_is_file('test/list/format_reverse');
+$cmd->stdout_is_file("test/${list_dir}/format_reverse");
$cmd->stderr_like($re_warning);
$cmd = Test::Command->new(
@@ -117,7 +127,7 @@ $cmd = Test::Command->new(
$cmd->exit_is_num(0);
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813729
-#$cmd->stdout_is_file('test/list/filename_recursive');
+#$cmd->stdout_is_file("test/${list_dir}/filename_recursive");
#$cmd->stderr_is_eq('');
# dummy tests to match number of planned tests
$cmd->exit_is_num(0);
@@ -127,19 +137,19 @@ $cmd = Test::Command->new( cmd => "$feh --customlist '%f; %h; %l; %m; %n; %p; "
. "%s; %t; %u; %w' $images" );
$cmd->exit_is_num(0);
-$cmd->stdout_is_file('test/list/custom');
+$cmd->stdout_is_file("test/${list_dir}/custom");
$cmd->stderr_like($re_warning);
$cmd = Test::Command->new( cmd => "$feh --list --quiet $images" );
$cmd->exit_is_num(0);
-$cmd->stdout_is_file('test/list/default');
+$cmd->stdout_is_file("test/${list_dir}/default");
$cmd->stderr_is_eq('');
$cmd = Test::Command->new(
cmd => "$feh --quiet --list --action 'echo \"%f %wx%h\" >&2' $images" );
$cmd->exit_is_num(0);
-$cmd->stdout_is_file('test/list/default');
+$cmd->stdout_is_file("test/${list_dir}/default");
$cmd->stderr_like($re_list_action);
$cmd
@@ -170,12 +180,16 @@ $cmd
= Test::Command->new( cmd => "$feh --list --min-dimension 16x16 $images_ok" );
$cmd->exit_is_num(0);
-$cmd->stdout_is_file('test/list/default');
+$cmd->stdout_is_file("test/${list_dir}/default");
$cmd->stderr_is_eq('');
$cmd
= Test::Command->new( cmd => "$feh --list --max-dimension 16x16 $images_ok" );
$cmd->exit_is_num(0);
-$cmd->stdout_is_file('test/list/default');
+$cmd->stdout_is_file("test/${list_dir}/default");
+$cmd->stderr_is_eq('');
+
+$cmd = Test::Command->new( cmd => "$feh --list test/tiny.pbm" );
+$cmd->exit_is_num(0);
$cmd->stderr_is_eq('');
diff --git a/test/list/custom b/test/list/custom
index b5ddb32..dbe2074 100644
--- a/test/list/custom
+++ b/test/list/custom
@@ -1,4 +1,4 @@
-test/ok/gif; 16; 4; list; gif; 256; 953; gif; 0; 16
-test/ok/jpg; 16; 4; list; jpg; 256; 354; jpeg; 0; 16
-test/ok/png; 16; 4; list; png; 256; 403; png; 0; 16
-test/ok/pnm; 16; 4; list; pnm; 256; 269; pnm; 0; 16
+test/ok/gif; 16; 4; list; gif; 256; 953; gif; 1; 16
+test/ok/jpg; 16; 4; list; jpg; 256; 354; jpeg; 2; 16
+test/ok/png; 16; 4; list; png; 256; 403; png; 3; 16
+test/ok/pnm; 16; 4; list; pnm; 256; 269; pnm; 4; 16
diff --git a/test/list_imlib2_1.6/custom b/test/list_imlib2_1.6/custom
new file mode 100644
index 0000000..40ac557
--- /dev/null
+++ b/test/list_imlib2_1.6/custom
@@ -0,0 +1,4 @@
+test/ok/gif; 16; 4; list; gif; 256; 953; gif; 1; 16
+test/ok/jpg; 16; 4; list; jpg; 256; 354; jpg; 2; 16
+test/ok/png; 16; 4; list; png; 256; 403; png; 3; 16
+test/ok/pnm; 16; 4; list; pnm; 256; 269; pnm; 4; 16
diff --git a/test/list_imlib2_1.6/default b/test/list_imlib2_1.6/default
new file mode 100644
index 0000000..e480db3
--- /dev/null
+++ b/test/list_imlib2_1.6/default
@@ -0,0 +1,5 @@
+NUM FORMAT WIDTH HEIGHT PIXELS SIZE ALPHA FILENAME
+1 gif 16 16 256 953 - test/ok/gif
+2 jpg 16 16 256 354 - test/ok/jpg
+3 png 16 16 256 403 X test/ok/png
+4 pnm 16 16 256 269 - test/ok/pnm
diff --git a/test/list_imlib2_1.6/filename b/test/list_imlib2_1.6/filename
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/test/list_imlib2_1.6/filename
@@ -0,0 +1 @@
+default \ No newline at end of file
diff --git a/test/list_imlib2_1.6/filename_recursive b/test/list_imlib2_1.6/filename_recursive
new file mode 100644
index 0000000..e42ce14
--- /dev/null
+++ b/test/list_imlib2_1.6/filename_recursive
@@ -0,0 +1,7 @@
+NUM FORMAT WIDTH HEIGHT PIXELS SIZE ALPHA FILENAME
+1 gif 16 16 256 953 - test/ok/gif
+2 jpg 16 16 256 354 - test/ok/jpg
+3 jpg 16 16 256 9k - test/ok/jpg_exif
+4 png 16 16 256 403 X test/ok/png
+5 pnm 16 16 256 269 - test/ok/pnm
+6 png 16 16 256 403 X test/ok/recursive/png
diff --git a/test/list_imlib2_1.6/format b/test/list_imlib2_1.6/format
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/test/list_imlib2_1.6/format
@@ -0,0 +1 @@
+default \ No newline at end of file
diff --git a/test/list_imlib2_1.6/format_reverse b/test/list_imlib2_1.6/format_reverse
new file mode 100644
index 0000000..3301f78
--- /dev/null
+++ b/test/list_imlib2_1.6/format_reverse
@@ -0,0 +1,5 @@
+NUM FORMAT WIDTH HEIGHT PIXELS SIZE ALPHA FILENAME
+1 pnm 16 16 256 269 - test/ok/pnm
+2 png 16 16 256 403 X test/ok/png
+3 jpg 16 16 256 354 - test/ok/jpg
+4 gif 16 16 256 953 - test/ok/gif
diff --git a/test/list_imlib2_1.6/height b/test/list_imlib2_1.6/height
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/test/list_imlib2_1.6/height
@@ -0,0 +1 @@
+default \ No newline at end of file
diff --git a/test/list_imlib2_1.6/name b/test/list_imlib2_1.6/name
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/test/list_imlib2_1.6/name
@@ -0,0 +1 @@
+default \ No newline at end of file
diff --git a/test/list_imlib2_1.6/pixels b/test/list_imlib2_1.6/pixels
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/test/list_imlib2_1.6/pixels
@@ -0,0 +1 @@
+default \ No newline at end of file
diff --git a/test/list_imlib2_1.6/size b/test/list_imlib2_1.6/size
new file mode 100644
index 0000000..7716239
--- /dev/null
+++ b/test/list_imlib2_1.6/size
@@ -0,0 +1,5 @@
+NUM FORMAT WIDTH HEIGHT PIXELS SIZE ALPHA FILENAME
+1 pnm 16 16 256 269 - test/ok/pnm
+2 jpg 16 16 256 354 - test/ok/jpg
+3 png 16 16 256 403 X test/ok/png
+4 gif 16 16 256 953 - test/ok/gif
diff --git a/test/list_imlib2_1.6/width b/test/list_imlib2_1.6/width
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/test/list_imlib2_1.6/width
@@ -0,0 +1 @@
+default \ No newline at end of file
diff --git a/test/mandoc.t b/test/mandoc.t
index 3740809..9e7ffc3 100755
--- a/test/mandoc.t
+++ b/test/mandoc.t
@@ -3,18 +3,25 @@ use strict;
use warnings;
use 5.010;
-use Test::More tests => 3;
+use Test::More tests => 1;
SKIP: {
- qx{mandoc -V};
+ my $mandoc_present = 0;
- if ( $? != 0 ) {
+ for my $path (split(qr{:}, $ENV{PATH})) {
+ if (-x "${path}/mandoc") {
+ $mandoc_present = 1;
+ last;
+ }
+ }
+
+ if ( not $mandoc_present ) {
diag('mandoc not installed, test skipped. This is NOT fatal.');
- skip( 'mandoc not installed', 3 );
+ skip( 'mandoc not installed', 1 );
}
- for my $file ( 'feh', 'feh-cam', 'gen-cam-menu' ) {
- qx{mandoc -Tlint man/${file}.1};
+ for my $file ('feh') {
+ qx{mandoc -Tlint -Werror man/${file}.1};
is( $?, 0, "${file}.1: Valid mdoc syntax" );
}
}
diff --git a/test/nx_action/loadable_action b/test/nx_action/loadable_action
index d173261..fbf517b 100644
--- a/test/nx_action/loadable_action
+++ b/test/nx_action/loadable_action
@@ -1,8 +1,8 @@
-touch test/ok/gif
-touch test/ok/jpg
-touch test/ok/png
-touch test/ok/pnm
test/ok/gif
+touch test/ok/gif
test/ok/jpg
+touch test/ok/jpg
test/ok/png
+touch test/ok/png
test/ok/pnm
+touch test/ok/pnm
diff --git a/test/nx_action/loadable_naction b/test/nx_action/loadable_naction
index d173261..fbf517b 100644
--- a/test/nx_action/loadable_naction
+++ b/test/nx_action/loadable_naction
@@ -1,8 +1,8 @@
-touch test/ok/gif
-touch test/ok/jpg
-touch test/ok/png
-touch test/ok/pnm
test/ok/gif
+touch test/ok/gif
test/ok/jpg
+touch test/ok/jpg
test/ok/png
+touch test/ok/png
test/ok/pnm
+touch test/ok/pnm
diff --git a/test/nx_action/unloadable_action b/test/nx_action/unloadable_action
index c16572e..cdf3ed8 100644
--- a/test/nx_action/unloadable_action
+++ b/test/nx_action/unloadable_action
@@ -1,8 +1,8 @@
-rm test/fail/gif
-rm test/fail/jpg
-rm test/fail/png
-rm test/fail/pnm
test/fail/gif
+rm test/fail/gif
test/fail/jpg
+rm test/fail/jpg
test/fail/png
+rm test/fail/png
test/fail/pnm
+rm test/fail/pnm
diff --git a/test/nx_action/unloadable_naction b/test/nx_action/unloadable_naction
index c16572e..cdf3ed8 100644
--- a/test/nx_action/unloadable_naction
+++ b/test/nx_action/unloadable_naction
@@ -1,8 +1,8 @@
-rm test/fail/gif
-rm test/fail/jpg
-rm test/fail/png
-rm test/fail/pnm
test/fail/gif
+rm test/fail/gif
test/fail/jpg
+rm test/fail/jpg
test/fail/png
+rm test/fail/png
test/fail/pnm
+rm test/fail/pnm
diff --git a/test/status b/test/status
index 2cda6d8..6db362e 100644
--- a/test/status
+++ b/test/status
@@ -76,15 +76,13 @@ Overall test status, what's covered / missing
[x] correct caption display
---collage
-
--customlist
[x] correct output
[x] format specifiers
---cycle-once
+--on-last-slide=quit
[x] closes feh window at end of slideshow
[x] combination with --slideshow-delay
diff --git a/test/tiny.pbm b/test/tiny.pbm
new file mode 100644
index 0000000..3fb3e4e
--- /dev/null
+++ b/test/tiny.pbm
@@ -0,0 +1,4 @@
+P4
+1 1
+
+