diff options
author | Jim Meyering <jim@meyering.net> | 1998-04-04 16:19:34 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-04-04 16:19:34 +0000 |
commit | 840a08ccdeaa2e339c881405d6e5ca443faa3f5d (patch) | |
tree | 3fb9e3c76e31ef9a4a9df4feda4a40ae7ef1bf87 /tests/stty | |
parent | 5fbcd963df047bfb00cc2018e6bcbb81ec298733 (diff) | |
download | coreutils-840a08ccdeaa2e339c881405d6e5ca443faa3f5d.tar.xz |
.
Diffstat (limited to 'tests/stty')
-rw-r--r-- | tests/stty/Makefile.am | 6 | ||||
-rw-r--r-- | tests/stty/Makefile.in | 227 | ||||
-rwxr-xr-x | tests/stty/row-col-1 | 54 |
3 files changed, 287 insertions, 0 deletions
diff --git a/tests/stty/Makefile.am b/tests/stty/Makefile.am new file mode 100644 index 000000000..e94bc8d7e --- /dev/null +++ b/tests/stty/Makefile.am @@ -0,0 +1,6 @@ +## Process this file with automake to produce Makefile.in -*-Makefile-*-. +AUTOMAKE_OPTIONS = 1.2f gnits + +TESTS = row-col-1 +EXTRA_DIST = $(TESTS) +TESTS_ENVIRONMENT = STTY=../../src/stty diff --git a/tests/stty/Makefile.in b/tests/stty/Makefile.in new file mode 100644 index 000000000..54ddd2975 --- /dev/null +++ b/tests/stty/Makefile.in @@ -0,0 +1,227 @@ +# Makefile.in generated automatically by automake 1.2h 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@ +GENCAT = @GENCAT@ +GETHOSTBYNAME_LIB = @GETHOSTBYNAME_LIB@ +GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNU_PACKAGE = @GNU_PACKAGE@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +KMEM_GROUP = @KMEM_GROUP@ +LIBOBJS = @LIBOBJS@ +LIB_CRYPT = @LIB_CRYPT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MAN = @MAN@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +NEED_SETGID = @NEED_SETGID@ +OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@ +OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@ +PACKAGE = @PACKAGE@ +PERL = @PERL@ +POFILES = @POFILES@ +POSUB = @POSUB@ +POW_LIBM = @POW_LIBM@ +RANLIB = @RANLIB@ +SEQ_LIBM = @SEQ_LIBM@ +SQRT_LIBM = @SQRT_LIBM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +YACC = @YACC@ +l = @l@ + +AUTOMAKE_OPTIONS = 1.2f gnits + +TESTS = row-col-1 +EXTRA_DIST = $(TESTS) +TESTS_ENVIRONMENT = STTY=../../src/stty +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: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/stty/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/stty + +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/stty/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/stty/row-col-1 b/tests/stty/row-col-1 new file mode 100755 index 000000000..09aa6fd65 --- /dev/null +++ b/tests/stty/row-col-1 @@ -0,0 +1,54 @@ +#! /bin/sh +# This script takes no arguments. + +: ${STTY=stty} + +if test "$VERBOSE" = yes; then + set -x + $RM --version +fi + +# Versions of GNU stty from shellutils-1.9.2c and earlier failed +# tests #2 and #4 when run on SunOS 4.1.3. + +tests=' +1 rows_40_columns_80 40_80 +2 rows_0_columns_0 0_0 +3 rows_40_columns_80 40_80 +4 rows_0 0_80 +5 columns_0 0_0 +6 rows_40 40_0 +7 rows_0 0_0 +8 columns_80 0_80 +9 rows_30 30_80 +NA LAST NA +' +set - $tests + +saved_size=.saved-size + +$STTY size > $saved_size || exit 1 + +fail=0 +while :; do + test_name=$1 + args=$2 + expected_result="`echo $3|tr _ ' '`" + test "$args" = empty && args='' + test "x$args" = xLAST && break + args=`echo x$args|tr _ ' '|sed 's/^x//'` + if test "$VERBOSE" = yes; then + # echo "testing \`$STTY $args; $STTY size\` = $expected_result ..." + echo "test $test_name... " | tr -d '\012' + fi + $STTY $args || exit 1 + test x"`$STTY size 2> /dev/null`" = "x$expected_result" \ + && ok=ok || ok=FAIL fail=1 + test "$VERBOSE" = yes && echo $ok + shift; shift; shift +done + +$STTY `cat $saved_size|sed 's/ / columns /;s/^/rows /'` || exit 1 +rm -f $saved_size + +exit $fail |