summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-05-09 12:11:53 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-05-09 12:11:53 +0200
commit5c3aeef977ee08f005224023569dd7c75bb2bd34 (patch)
treeedc4b7ff5d59b3265ed02274519a1727235e90e5
parente21d5fbdf48c16975ca42fc29a2daa7401db55f6 (diff)
test/feh.t: Give a proper error if PACKAGE / VERSION are undefined
-rw-r--r--test/feh.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/feh.t b/test/feh.t
index 2db0db0..29ba144 100644
--- a/test/feh.t
+++ b/test/feh.t
@@ -9,6 +9,23 @@ my $images = 'test/ok.* test/fail.*';
my ($feh_name, $feh_version) = @ENV{'PACKAGE', 'VERSION'};
+my $err_no_env = <<'EOF';
+
+Unable to determine feh PACKAGE or VERSION.
+This is most likely because you ran 'prove test' or 'perl test/feh.t'.
+Sinc this test uses make variables and is therefore designed to be run from
+the Makefile only, use 'make test' instead.
+
+If you absolutely need to run it the other way, use
+ PACKAGE=feh VERSION=1.5 ${your_command}
+(with the appropiate values, of course).
+
+EOF
+
+if (length($feh_name) == 0 or length($feh_version) == 0) {
+ die($err_no_env);
+}
+
my $re_warning =
qr{${feh_name} WARNING: test/fail\.... \- No Imlib2 loader for that file format\n};
my $re_loadable = qr{test/ok\....};