* Makefile.am (SUBDIRS): List tests after ".".
Move most test-related things from here to ...
* tests/Makefile.am: ... here.
* configure.ac (AC_CONFIG_FILES): Add tests/Makefile.
* tests/helin-segv: Adjust.
* tests/help-version: Likewise.
* tests/hufts: Likewise.
* tests/memcpy-abuse: Likewise.
* tests/mixed: Likewise.
* tests/null-suffix-clobber: Likewise.
* tests/stdin: Likewise.
* tests/trailing-nul: Likewise.
* tests/zdiff: Likewise.
* tests/zgrep-f: Likewise.
* tests/zgrep-signal: Likewise.
* tests/znew-k: Likewise.
ALL_RECURSIVE_TARGETS =
-SUBDIRS = lib doc
+SUBDIRS = lib doc . tests
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(top_srcdir)/lib
AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \
ChangeLog-2007 \
dist-check.mk \
- tests/hufts-segv.gz \
algorithm.doc amiga/match.a amiga/Makefile.gcc amiga/Makefile.sasc \
amiga/tailor.c amiga/utime.h atari/Makefile.st crypt.h \
gunzip.in gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
sample/ztouch sample/add.c sample/sub.c sample/zread.c sample/zfile \
tailor.h vms/Makefile.mms vms/gzip.hlp vms/vms.c vms/Readme.vms \
vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zcat.in zcmp.in zdiff.in \
- zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in \
- tests/init.sh
+ zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in
bin_PROGRAMS = gzip
bin_SCRIPTS = gunzip gzexe zcat zcmp zdiff \
done
@echo 'Test succeeded.'
-TESTS = \
- tests/helin-segv \
- tests/help-version \
- tests/hufts \
- tests/memcpy-abuse \
- tests/mixed \
- tests/null-suffix-clobber \
- tests/stdin \
- tests/trailing-nul \
- tests/zdiff \
- tests/zgrep-f \
- tests/zgrep-signal \
- tests/znew-k
-
-EXTRA_DIST += $(TESTS)
-EXTRA_DIST += tests/init.cfg
-
install-exec-hook: remove-installed-links
install-exec-hook remove-installed-links:
@for prog_ext in $(bin_PROGRAMS) $(bin_SCRIPTS); do \
MOSTLYCLEANFILES = _match.i match_.s _match.S gzip.doc.gz \
gunzip gzexe zcat zcmp zdiff zegrep zfgrep zforce zgrep zless zmore znew
-
-# Note that the first lines are statements. They ensure that environment
-# variables that can perturb tests are unset or set to expected values.
-# The rest are envvar settings that propagate build-related Makefile
-# variables to test scripts.
-TESTS_ENVIRONMENT = \
- tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
- TMPDIR=$$tmp__; export TMPDIR; \
- exec 9>&2; \
- shell_or_perl_() { \
- if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then \
- if $(PERL) -e 'use warnings' > /dev/null 2>&1; then \
- grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=; \
- $(PERL) -w$$T_ -I$(srcdir) -MCoreutils \
- -M"CuTmpdir qw($$f)" -- "$$1"; \
- else \
- echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
- "so skipping this test"; \
- (exit 77); \
- fi; \
- else \
- $(SHELL) "$$1"; \
- fi; \
- }; \
- export \
- abs_top_builddir='$(abs_top_builddir)' \
- abs_top_srcdir='$(abs_top_srcdir)' \
- abs_srcdir='$(abs_srcdir)' \
- built_programs='$(PROGRAMS) $(SCRIPTS)' \
- srcdir='$(srcdir)' \
- top_srcdir='$(top_srcdir)' \
- CC='$(CC)' \
- MAKE=$(MAKE) \
- PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
- PACKAGE_VERSION=$(PACKAGE_VERSION) \
- PERL='$(PERL)' \
- PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
- REPLACE_GETCWD=$(REPLACE_GETCWD) \
- PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
- ; shell_or_perl_
-
-VERBOSE = yes
AC_TYPE_SIZE_T
AC_TYPE_OFF_T
-AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile])
+AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile tests/Makefile])
AC_OUTPUT
--- /dev/null
+## Process this file with automake to create Makefile.in
+# Copyright 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+TESTS = \
+ helin-segv \
+ help-version \
+ hufts \
+ memcpy-abuse \
+ mixed \
+ null-suffix-clobber \
+ stdin \
+ trailing-nul \
+ zdiff \
+ zgrep-f \
+ zgrep-signal \
+ znew-k
+
+EXTRA_DIST = \
+ $(TESTS) \
+ init.cfg \
+ init.sh \
+ hufts-segv.gz
+
+built_programs = \
+ gzip \
+ gunzip \
+ gzexe \
+ zcat \
+ zcmp \
+ zdiff \
+ zegrep \
+ zfgrep \
+ zforce \
+ zgrep \
+ zless \
+ zmore \
+ znew
+
+TESTS_ENVIRONMENT = \
+ tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
+ TMPDIR=$$tmp__; export TMPDIR; \
+ exec 9>&2; \
+ shell_or_perl_() { \
+ if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then \
+ if $(PERL) -e 'use warnings' > /dev/null 2>&1; then \
+ grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=; \
+ $(PERL) -w$$T_ -I$(srcdir) -MCoreutils \
+ -M"CuTmpdir qw($$f)" -- "$$1"; \
+ else \
+ echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
+ "so skipping this test"; \
+ (exit 77); \
+ fi; \
+ else \
+ $(SHELL) "$$1"; \
+ fi; \
+ }; \
+ export \
+ LC_ALL=C \
+ abs_top_builddir='$(abs_top_builddir)' \
+ abs_top_srcdir='$(abs_top_srcdir)' \
+ abs_srcdir='$(abs_srcdir)' \
+ built_programs='$(built_programs)' \
+ srcdir='$(srcdir)' \
+ top_srcdir='$(top_srcdir)' \
+ CC='$(CC)' \
+ GZIP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
+ MAKE=$(MAKE) \
+ PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
+ PACKAGE_VERSION=$(PACKAGE_VERSION) \
+ PERL='$(PERL)' \
+ SHELL='$(SHELL)' \
+ PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
+ ; shell_or_perl_
+
+VERBOSE = yes
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- gzip --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
# This test case was provided by Aki Helin.
printf '\037\235\220\0\0\0\304' > helin.gz || framework_failure
export SHELL
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
expected_failure_status_chroot=125
expected_failure_status_env=125
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- zgrep --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
printf '\n...: invalid compressed data--format violated\n' > exp \
|| framework_failure
fail=0
-gzip -dc "$abs_srcdir/tests/hufts-segv.gz" > out 2> err
+gzip -dc "$abs_srcdir/hufts-segv.gz" > out 2> err
test $? = 1 || fail=1
compare /dev/null out || fail=1
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- gzip --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
# The input must be larger than 32KiB and slightly
# less uniform than e.g., all zeros.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- zgrep --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
printf 'xxx\nyyy\n' > exp2 || framework_failure
printf 'aaa\nbbb\nccc\n' > exp3 || framework_failure
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- gzip --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
printf anything | gzip > F.gz || framework_failure
echo y > yes || framework_failure
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- zgrep --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
printf a | gzip > in || framework_failure
printf aaa > exp || framework_failure
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- gzip --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
(echo 0 | gzip; printf '\0') > 0.gz || framework_failure
(echo 00 | gzip; printf '\0\0') > 00.gz || framework_failure
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- zdiff --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
echo a > a || framework_failure
echo b > b || framework_failure
# limit so don't run it by default.
: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ .
+. "$srcdir/init.sh"; path_prepend_ ..
require_POSIX_grep_
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- gzip --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"
+. "$srcdir/init.sh"; path_prepend_ ..
echo a | gzip -c > f.gz || framework_failure
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# limit so don't run it by default.
-if test "$VERBOSE" = yes; then
- set -x
- gzip --version
-fi
-
: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ "`pwd`"
+. "$srcdir/init.sh"; path_prepend_ ..
cat <<'EOF' >compress || framework_failure
#!/bin/sh