summaryrefslogtreecommitdiff
path: root/tests/misc/stty
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/stty')
-rwxr-xr-xtests/misc/stty42
1 files changed, 3 insertions, 39 deletions
diff --git a/tests/misc/stty b/tests/misc/stty
index cfc70c153..ae6565649 100755
--- a/tests/misc/stty
+++ b/tests/misc/stty
@@ -23,20 +23,8 @@ print_ver_ stty
require_controlling_input_terminal_
trap '' TTOU # Ignore SIGTTOU
-# 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_iutf8=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
-
+# Get the reversible settings from stty.c.
+stty_reversible_init_
saved_state=.saved-state
stty --save > $saved_state || fail=1
@@ -70,35 +58,11 @@ for opt in $options; do
# Likewise, 'stty -cread' would fail, so skip that, too.
test $opt = cread && continue
- eval rev=\$REV_$opt
- if test -n "$rev"; then
+ if stty_reversible_query_ "$opt" ; 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
-
- eval rev1=\$REV_$opt1
- eval rev2=\$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)
Exit $fail