From 5c3aeef977ee08f005224023569dd7c75bb2bd34 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 9 May 2010 12:11:53 +0200 Subject: test/feh.t: Give a proper error if PACKAGE / VERSION are undefined --- test/feh.t | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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\....}; -- cgit v1.2.3