summaryrefslogtreecommitdiff
path: root/tests/stty
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-11 23:30:49 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:39 +0200
commit0539705768992ebcc290bc859f64e27898c7f958 (patch)
tree9e49d8f9aca7097cdff462da3e67cbc2ac941cda /tests/stty
parent44629cf147ba5c3827b5252e36ce50ce447b36b8 (diff)
downloadcoreutils-0539705768992ebcc290bc859f64e27898c7f958.tar.xz
Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
Reflect these renamings: od/od-N misc/od-N od/x8 misc/od-x8 sha1sum/basic-1 misc/sha1sum sha1sum/sample-vec misc/sha1sum-vec shred/exact misc/shred-exact shred/remove misc/shred-remove stty/basic-1 misc/stty stty/invalid misc/stty-invalid stty/row-col-1 misc/stty-row-col * tests/misc/Makefile.am (TESTS): Add the new files. * tests/Makefile.am (SUBDIRS): Remove the dir names. * tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the directories. * configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile names.
Diffstat (limited to 'tests/stty')
-rw-r--r--tests/stty/Makefile.am6
-rwxr-xr-xtests/stty/basic-1104
-rwxr-xr-xtests/stty/invalid62
-rwxr-xr-xtests/stty/row-col-186
4 files changed, 0 insertions, 258 deletions
diff --git a/tests/stty/Makefile.am b/tests/stty/Makefile.am
deleted file mode 100644
index b3c460eb9..000000000
--- a/tests/stty/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-## Process this file with automake to produce Makefile.in -*-Makefile-*-.
-TESTS = invalid row-col-1 basic-1
-EXTRA_DIST = $(TESTS)
-TESTS_ENVIRONMENT = \
- CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
- PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
diff --git a/tests/stty/basic-1 b/tests/stty/basic-1
deleted file mode 100755
index 160e436ba..000000000
--- a/tests/stty/basic-1
+++ /dev/null
@@ -1,104 +0,0 @@
-#! /bin/sh
-# Make sure stty can parse most of its options.
-
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 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 of the License, 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/>.
-
-if test "$VERBOSE" = yes; then
- set -x
- stty --version
-fi
-
-# Make sure there's a tty on stdin.
-. $srcdir/../input-tty
-
-# The following list of reversible options was generated with
-# grep -w REV stty.c|sed -n '/^ {"/{s//REV_/;s/".*/=1/;p;}'|fmt
-REV_parenb=1 REV_parodd=1 REV_hupcl=1 REV_hup=1 REV_cstopb=1 REV_cread=1
-REV_clocal=1 REV_crtscts=1 REV_ignbrk=1 REV_brkint=1 REV_ignpar=1
-REV_parmrk=1 REV_inpck=1 REV_istrip=1 REV_inlcr=1 REV_igncr=1 REV_icrnl=1
-REV_ixon=1 REV_ixoff=1 REV_tandem=1 REV_iuclc=1 REV_ixany=1 REV_imaxbel=1
-REV_opost=1 REV_olcuc=1 REV_ocrnl=1 REV_onlcr=1 REV_onocr=1 REV_onlret=1
-REV_ofill=1 REV_ofdel=1 REV_isig=1 REV_icanon=1 REV_iexten=1 REV_echo=1
-REV_echoe=1 REV_crterase=1 REV_echok=1 REV_echonl=1 REV_noflsh=1
-REV_xcase=1 REV_tostop=1 REV_echoprt=1 REV_prterase=1 REV_echoctl=1
-REV_ctlecho=1 REV_echoke=1 REV_crtkill=1 REV_evenp=1 REV_parity=1
-REV_oddp=1 REV_nl=1 REV_cooked=1 REV_raw=1 REV_pass8=1 REV_litout=1
-REV_cbreak=1 REV_decctlq=1 REV_tabs=1 REV_lcase=1 REV_LCASE=1
-
-fail=0
-
-saved_state=.saved-state
-stty --save > $saved_state || fail=1
-stty `cat $saved_state` || fail=1
-
-# This would segfault prior to sh-utils-2.0j.
-stty erase - || fail=1
-
-# These would improperly ignore invalid options through coreutils 5.2.1.
-stty -F 2>/dev/null && fail=1
-stty -raw -F no/such/file 2>/dev/null && fail=1
-stty -raw -a 2>/dev/null && fail=1
-
-# Build a list of all boolean options stty accepts on this system.
-# Don't depend on terminal width. Put each option on its own line,
-# remove all non-boolean ones, then remove any leading hyphens.
-sed_del='/^speed/d;/^rows/d;/^columns/d;/ = /d'
-options=`stty -a | tr -s ';' '\n' | sed "s/^ //;$sed_del;s/-//g"`
-
-# Take them one at a time, with and without the leading `-'.
-for opt in $options; do
- # `stty parenb' and `stty -parenb' fail with this message
- # stty: standard input: unable to perform all requested operations
- # on Linux 2.2.0-pre4 kernels, so skip those tests.
- test $opt = parenb && continue
- stty $opt || fail=1
-
- # Likewise, `stty -cread' would fail, so skip that, too.
- test $opt = cread && continue
- rev=`eval echo "\\\$REV_$opt"`
- if test -n "$rev"; then
- stty -$opt || { fail=1; echo -$opt; }
- fi
-done
-
-if test -n "$RUN_LONG_TESTS"; then
- # Take them in pairs.
- for opt1 in $options; do
- echo .|tr -d '\n'
- for opt2 in $options; do
-
- stty $opt1 $opt2 || fail=1
-
- rev1=`eval echo "\\\$REV_$opt1"`
- rev2=`eval echo "\\\$REV_$opt2"`
- if test -n "$rev1"; then
- stty -$opt1 $opt2 || fail=1
- fi
- if test -n "$rev2"; then
- stty $opt1 -$opt2 || fail=1
- fi
- if test "$rev1$rev2" = 11; then
- stty -$opt1 -$opt2 || fail=1
- fi
- done
- done
-fi
-
-stty `cat $saved_state`
-rm -f $saved_state
-
-exit $fail
diff --git a/tests/stty/invalid b/tests/stty/invalid
deleted file mode 100755
index 93789345f..000000000
--- a/tests/stty/invalid
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-# Ensure that stty diagnoses invalid inputs, rather than silently misbehaving.
-
-# Copyright (C) 2007 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 of the License, 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/>.
-
-if test "$VERBOSE" = yes; then
- set -x
- stty --version
-fi
-
-# Make sure there's a tty on stdin.
-. $srcdir/../input-tty
-
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
-
-fail=0
-
-saved_state=`stty -g` || fail=1
-stty $saved_state || fail=1
-
-# Before coreutils-6.10, if stty were given an argument with 35 colons
-# separating 36 hexadecimal strings, stty would fail to diagnose as invalid
-# any number that was out of range as long as sscanf happened to
-# overflow/wrap it back into the range of the corresponding type (either
-# tcflag_t or cc_t).
-
-# For each of the following, before 6.10, stty would fail to
-# diagnose the error on at least Solaris 10.
-hex_2_64=10000000000000000
-stty `echo $saved_state |sed 's/^[^:]*:/'$hex_2_64:/` 2>/dev/null && fail=1
-stty `echo $saved_state |sed 's/:[0-9a-f]*$/:'$hex_2_64/` 2>/dev/null && fail=1
-
-# Just in case either of the above mistakenly succeeds (and changes
-# the state of our tty), try to restore the initial state.
-stty $saved_state || fail=1
-
-(exit $fail); exit $fail
diff --git a/tests/stty/row-col-1 b/tests/stty/row-col-1
deleted file mode 100755
index 65fc91e32..000000000
--- a/tests/stty/row-col-1
+++ /dev/null
@@ -1,86 +0,0 @@
-#! /bin/sh
-# Test "stty" with rows and columns.
-
-# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 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 of the License, 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/>.
-
-
-# This script takes no arguments.
-
-if test "$VERBOSE" = yes; then
- set -x
- stty --version
-fi
-
-# Setting this envvar to a very small value used to cause e.g., `stty size'
-# to generate slightly different output on certain systems.
-COLUMNS=80
-export COLUMNS
-
-# Make sure we get English-language behavior.
-# See the report about a possibly-related Solaris problem by Alexandre Peshansky
-# <http://lists.gnu.org/archive/html/bug-coreutils/2004-10/msg00035.html>.
-# Currently stty isn't localized, but it might be in the future.
-LC_ALL=C
-export LC_ALL
-
-# Make sure there's a tty on stdin.
-. $srcdir/../input-tty
-
-# 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_1_columns_1 1_1
-3 rows_40_columns_80 40_80
-4 rows_1 1_80
-5 columns_1 1_1
-6 rows_40 40_1
-7 rows_1 1_1
-8 columns_80 1_80
-9 rows_30 30_80
-NA LAST NA
-'
-set $tests
-
-saved_size=`stty size` && test -n "$saved_size" \
- || { echo "$0: skipping this test: can't get window size" 1>&2;
- exit 77; exit; }
-
-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 '\n'
- 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
-
-set x $saved_size
-stty rows $2 columns $3 || exit 1
-
-exit $fail