diff options
Diffstat (limited to 'tests/init.cfg')
-rw-r--r-- | tests/init.cfg | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/init.cfg b/tests/init.cfg index 7bcd512a3..2e43c162d 100644 --- a/tests/init.cfg +++ b/tests/init.cfg @@ -241,6 +241,33 @@ rwx_to_mode_() echo "=$u$g$o" } +# Set the global variable stty_reversible_ to a space-separated list of the +# reversible settings from stty.c. stty_reversible_ also starts and ends +# with a space. +stty_reversible_init_() +{ + # Pad start with one space for the first option to match in query function. + stty_reversible_=' '$(perl -lne '/^ *{"(.*?)",.*\bREV\b/ and print $1' \ + $abs_top_srcdir/src/stty.c | tr '\n' ' ') + # Ensure that there are at least 62, i.e., so we're alerted if + # reformatting the source empties the list. + test 62 -le $(echo "$stty_reversible_"|wc -w) \ + || framework_failure_ "too few reversible settings" +} + +# Test whether $1 is one of stty's reversible options. +stty_reversible_query_() +{ + case $stty_reversible_ in + '') + framework_failure_ "stty_reversible_init_() not called?";; + *" $1 "*) + return 0;; + *) + return 1;; + esac +} + skip_if_() { case $1 in |