Commit d3d55eae authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Adjust tests for Imlib2 1.6+ ("jpeg" format is now "jpg")

Closes #497
parent 6791c2cb
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -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('');
+4 −0
Original line number Diff line number Diff line
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
+5 −0
Original line number Diff line number Diff line
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
+1 −0
Original line number Diff line number Diff line
default
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
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
Loading