maint: enable more syntax checks
[debian/gzip] / tests / Makefile.am
1 ## Process this file with automake to create Makefile.in
2 # Copyright 2010-2014 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   z-suffix                              \
29   zdiff                                 \
30   zgrep-f                               \
31   zgrep-context                         \
32   zgrep-signal                          \
33   znew-k
34
35 EXTRA_DIST =                            \
36   $(TESTS)                              \
37   init.cfg                              \
38   init.sh                               \
39   hufts-segv.gz
40
41 built_programs = \
42   gzip          \
43   gunzip        \
44   gzexe         \
45   zcat          \
46   zcmp          \
47   zdiff         \
48   zegrep        \
49   zfgrep        \
50   zforce        \
51   zgrep         \
52   zless         \
53   zmore         \
54   znew
55
56 TESTS_ENVIRONMENT =                             \
57   tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
58   TMPDIR=$$tmp__; export TMPDIR;                \
59   shell_or_perl_() {                            \
60     if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then                 \
61       if $(PERL) -e 'use warnings' > /dev/null 2>&1; then               \
62         grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=;   \
63         $(PERL) -w$$T_ -I$(srcdir) -MCoreutils                          \
64               -M"CuTmpdir qw($$f)" -- "$$1";    \
65       else                                      \
66         echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
67           "so skipping this test";              \
68         (exit 77);                              \
69       fi;                                       \
70     else                                        \
71       $(SHELL) "$$1";                           \
72     fi;                                         \
73   };                                            \
74   LC_ALL=C; export LC_ALL;                                              \
75   VERSION=$(VERSION); export VERSION;                                   \
76   abs_top_builddir='$(abs_top_builddir)'; export abs_top_builddir;      \
77   abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir;            \
78   abs_srcdir='$(abs_srcdir)'; export abs_srcdir;                        \
79   built_programs='$(built_programs)'; export built_programs;            \
80   srcdir='$(srcdir)'; export srcdir;                                    \
81   top_srcdir='$(top_srcdir)'; export top_srcdir;                        \
82   CC='$(CC)'; export CC;                                                \
83   GREP='$(GREP)'; export GREP;                                          \
84   GZIP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'`; export GZIP_TEST_NAME; \
85   MAKE=$(MAKE); export MAKE;                                            \
86   PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'; export PACKAGE_BUGREPORT;   \
87   PACKAGE_VERSION=$(PACKAGE_VERSION); export PACKAGE_VERSION;           \
88   PERL='$(PERL)'; export PERL;                                          \
89   SHELL='$(SHELL)'; export SHELL;                                       \
90   PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH"; export PATH;     \
91   9>&2
92
93 VERBOSE = yes