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