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