summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-06-04 08:32:06 +0200
committerDaniel Friesel <derf@finalrewind.org>2013-06-04 08:32:06 +0200
commitf56549cdd267bcc20156af0c206520fef77ff06f (patch)
treebf9c174a02014e26b25ee272c1fa429320f8b966 /test
parent919ff551a5800a582c65af768e91e98011138bad (diff)
downloadfeh-f56549cdd267bcc20156af0c206520fef77ff06f.zip
fix tests failing when compiled with help=1HEADmaster
Diffstat (limited to 'test')
-rw-r--r--test/feh.t20
-rw-r--r--test/no-loadable-files.help2
2 files changed, 20 insertions, 2 deletions
diff --git a/test/feh.t b/test/feh.t
index 8f415f3..e530087 100644
--- a/test/feh.t
+++ b/test/feh.t
@@ -10,6 +10,7 @@ my $feh = "src/feh";
my $images_ok = 'test/ok/gif test/ok/jpg test/ok/png test/ok/pnm';
my $images_fail = 'test/fail/gif test/fail/jpg test/fail/png test/fail/pnm';
my $images = "${images_ok} ${images_fail}";
+my $has_help = 0;
my $feh_name = $ENV{'PACKAGE'};
@@ -33,6 +34,11 @@ if (length($feh_name) == 0) {
die($err_no_env);
}
+my $version = qx{$feh --version};
+if ($version =~ m{ Compile-time \s switches : \s .* help }ox) {
+ $has_help = 1;
+}
+
my $re_warning =
qr{${feh_name} WARNING: test/fail/... \- No Imlib2 loader for that file format\n};
my $re_loadable = qr{test/ok/...};
@@ -139,13 +145,23 @@ $cmd = Test::Command->new(cmd => "$feh --list --min-dimension 20x20 $images_ok")
$cmd->exit_is_num(1);
$cmd->stdout_is_eq('');
-$cmd->stderr_is_file('test/no-loadable-files');
+if ($has_help) {
+ $cmd->stderr_is_file('test/no-loadable-files.help');
+}
+else {
+ $cmd->stderr_is_file('test/no-loadable-files');
+}
$cmd = Test::Command->new(cmd => "$feh --list --max-dimension 10x10 $images_ok");
$cmd->exit_is_num(1);
$cmd->stdout_is_eq('');
-$cmd->stderr_is_file('test/no-loadable-files');
+if ($has_help) {
+ $cmd->stderr_is_file('test/no-loadable-files.help');
+}
+else {
+ $cmd->stderr_is_file('test/no-loadable-files');
+}
$cmd = Test::Command->new(cmd => "$feh --list --min-dimension 16x16 $images_ok");
diff --git a/test/no-loadable-files.help b/test/no-loadable-files.help
new file mode 100644
index 0000000..b1b61d8
--- /dev/null
+++ b/test/no-loadable-files.help
@@ -0,0 +1,2 @@
+feh: No loadable images specified.
+See 'feh --help' or 'man feh' for detailed usage information