tests: port to Solaris 10 /bin/sh
[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   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   LC_ALL=C; export LC_ALL;                                              \
73   VERSION=$(VERSION); export VERSION;                                   \
74   abs_top_builddir='$(abs_top_builddir)'; export abs_top_builddir;      \
75   abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir;            \
76   abs_srcdir='$(abs_srcdir)'; export abs_srcdir;                        \
77   built_programs='$(built_programs)'; export built_programs;            \
78   srcdir='$(srcdir)'; export srcdir;                                    \
79   top_srcdir='$(top_srcdir)'; export top_srcdir;                        \
80   CC='$(CC)'; export CC;                                                \
81   GZIP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'`; export GZIP_TEST_NAME; \
82   MAKE=$(MAKE); export MAKE;                                            \
83   PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'; export PACKAGE_BUGREPORT;   \
84   PACKAGE_VERSION=$(PACKAGE_VERSION); export PACKAGE_VERSION;           \
85   PERL='$(PERL)'; export PERL;                                          \
86   SHELL='$(SHELL)'; export SHELL;                                       \
87   PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH"; export PATH;     \
88   9>&2
89
90 VERBOSE = yes