summaryrefslogtreecommitdiff
path: root/test/feh.t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-02 18:38:06 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-02 18:39:10 +0100
commitd3d55eae78debd3e8986a8ada1c321c1e60cfaef (patch)
tree329da892505fff177f41df22740d3cfcf3b65e73 /test/feh.t
parent6791c2cbfaf1d2f3b657616b11e0e4d02312cdfd (diff)
Adjust tests for Imlib2 1.6+ ("jpeg" format is now "jpg")
Closes #497
Diffstat (limited to 'test/feh.t')
-rw-r--r--test/feh.t25
1 files changed, 16 insertions, 9 deletions
diff --git a/test/feh.t b/test/feh.t
index 47dfbc3..baf5ee4 100644
--- a/test/feh.t
+++ b/test/feh.t
@@ -34,6 +34,13 @@ 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;
@@ -93,14 +100,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 +115,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 +124,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 +134,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 +177,12 @@ $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('');