Imported Upstream version 1.6
[debian/gzip] / tests / Makefile.am
1 ## Process this file with automake to create Makefile.in
2 # Copyright 2010-2013 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 TESTS =                                 \
18   helin-segv                            \
19   help-version                          \
20   hufts                                 \
21   keep                                  \
22   memcpy-abuse                          \
23   mixed                                 \
24   null-suffix-clobber                   \
25   stdin                                 \
26   trailing-nul                          \
27   unpack-invalid                        \
28   zdiff                                 \
29   zgrep-f                               \
30   zgrep-context                         \
31   zgrep-signal                          \
32   znew-k
33
34 EXTRA_DIST =                            \
35   $(TESTS)                              \
36   init.cfg                              \
37   init.sh                               \
38   hufts-segv.gz
39
40 built_programs = \
41   gzip          \
42   gunzip        \
43   gzexe         \
44   zcat          \
45   zcmp          \
46   zdiff         \
47   zegrep        \
48   zfgrep        \
49   zforce        \
50   zgrep         \
51   zless         \
52   zmore         \
53   znew
54
55 TESTS_ENVIRONMENT =                             \
56   tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
57   TMPDIR=$$tmp__; export TMPDIR;                \
58   shell_or_perl_() {                            \
59     if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then                 \
60       if $(PERL) -e 'use warnings' > /dev/null 2>&1; then               \
61         grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=;   \
62         $(PERL) -w$$T_ -I$(srcdir) -MCoreutils                          \
63               -M"CuTmpdir qw($$f)" -- "$$1";    \
64       else                                      \
65         echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
66           "so skipping this test";              \
67         (exit 77);                              \
68       fi;                                       \
69     else                                        \
70       $(SHELL) "$$1";                           \
71     fi;                                         \
72   };                                            \
73   LC_ALL=C; export LC_ALL;                                              \
74   VERSION=$(VERSION); export VERSION;                                   \
75   abs_top_builddir='$(abs_top_builddir)'; export abs_top_builddir;      \
76   abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir;            \
77   abs_srcdir='$(abs_srcdir)'; export abs_srcdir;                        \
78   built_programs='$(built_programs)'; export built_programs;            \
79   srcdir='$(srcdir)'; export srcdir;                                    \
80   top_srcdir='$(top_srcdir)'; export top_srcdir;                        \
81   CC='$(CC)'; export CC;                                                \
82   GZIP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'`; export GZIP_TEST_NAME; \
83   MAKE=$(MAKE); export MAKE;                                            \
84   PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'; export PACKAGE_BUGREPORT;   \
85   PACKAGE_VERSION=$(PACKAGE_VERSION); export PACKAGE_VERSION;           \
86   PERL='$(PERL)'; export PERL;                                          \
87   SHELL='$(SHELL)'; export SHELL;                                       \
88   PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH"; export PATH;     \
89   9>&2
90
91 VERBOSE = yes