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