diff options
author | Jim Meyering <jim@meyering.net> | 1998-07-18 13:51:11 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-07-18 13:51:11 +0000 |
commit | 7fc23ef6256019a86d12b6303d36297f49ad1031 (patch) | |
tree | a2e82e30c8a1853c7d4d0979fff4f491f1aa5533 /tests | |
parent | 1bd7deb235900838c41c960b314198314cf50c0e (diff) | |
download | coreutils-7fc23ef6256019a86d12b6303d36297f49ad1031.tar.xz |
.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/touch/.cvsignore | 1 | ||||
-rw-r--r-- | tests/touch/Makefile.am | 14 | ||||
-rw-r--r-- | tests/touch/Makefile.in | 225 | ||||
-rwxr-xr-x | tests/touch/empty-file | 49 |
4 files changed, 289 insertions, 0 deletions
diff --git a/tests/touch/.cvsignore b/tests/touch/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/tests/touch/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/tests/touch/Makefile.am b/tests/touch/Makefile.am new file mode 100644 index 000000000..74578fc9d --- /dev/null +++ b/tests/touch/Makefile.am @@ -0,0 +1,14 @@ +## Process this file with automake to produce Makefile.in -*-Makefile-*-. +AUTOMAKE_OPTIONS = 1.3 gnits + +TESTS = empty-file +EXTRA_DIST = $(TESTS) +TESTS_ENVIRONMENT = \ + DF=../../src/df \ + LN=../../src/ln \ + LS=../../src/ls \ + MKDIR=../../src/mkdir \ + MKNOD=../../src/mknod \ + MV=../../src/mv \ + RM=../../src/rm \ + TOUCH=../../src/touch diff --git a/tests/touch/Makefile.in b/tests/touch/Makefile.in new file mode 100644 index 000000000..07b5eeec3 --- /dev/null +++ b/tests/touch/Makefile.in @@ -0,0 +1,225 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DF_PROG = @DF_PROG@ +GENCAT = @GENCAT@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LIBOBJS = @LIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MVDIR_PROG = @MVDIR_PROG@ +PACKAGE = @PACKAGE@ +PERL = @PERL@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +YACC = @YACC@ +l = @l@ + +AUTOMAKE_OPTIONS = 1.3 gnits + +TESTS = empty-file +EXTRA_DIST = $(TESTS) +TESTS_ENVIRONMENT = \ + DF=../../src/df \ + LN=../../src/ln \ + LS=../../src/ls \ + MKDIR=../../src/mkdir \ + MKNOD=../../src/mknod \ + MV=../../src/mv \ + RM=../../src/rm \ + TOUCH=../../src/touch +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +all: Makefile + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/touch/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = tests/touch + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits tests/touch/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +check-TESTS: $(TESTS) + @failed=0; all=0; \ + srcdir=$(srcdir); export srcdir; \ + for tst in $(TESTS); do \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ + echo "PASS: $$tst"; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 +info: +dvi: +check: all + $(MAKE) check-TESTS +installcheck: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-generic + +clean: clean-generic mostlyclean + +distclean: distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +.PHONY: tags distdir check-TESTS info dvi installcheck install-exec \ +install-data install uninstall all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/touch/empty-file b/tests/touch/empty-file new file mode 100755 index 000000000..8dcc49dd9 --- /dev/null +++ b/tests/touch/empty-file @@ -0,0 +1,49 @@ +#!/bin/sh +# Make sure touch can set the mtime on an empty file. +# Volker Borchert reported that touch 3.16r (and presumably all before that) +# fails to work on SunOS 4.1.3 with `most of the recommended patches' when +# the empty file is on an NFS-mounted 4.2 volume. + +: ${RM=rm} +: ${TOUCH=touch} + +if test "$VERBOSE" = yes; then + set -x + $TOUCH --version +fi + +# FIXME: find writable directories on other partitions +# and run the test in those directories, too. + +dirs=. + +framework_failure=0 + +for d in $dirs; do + rm -rf $d/a $d/b + : > $d/a || framework_failure=1 + : > $d/b || framework_failure=1 +done + +if test $framework_failure = 1; then + echo 'failure in testing framework' + exit 1 +fi + +sleep 2 +for d in $dirs; do + $TOUCH $d/a || fail=1 + set x `$LS -t $d/a $d/b` + test "$*" = "x $d/a $d/b" || fail=1 +done + +sleep 2 +for d in $dirs; do + $TOUCH $d/b + set x `$LS -t $d/a $d/b` + test "$*" = "x $d/b $d/a" || fail=1 + + $RM -rf $d/a $d/b +done + +exit $fail |