]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix stty-row-col failure on small fixed terminals
authorPádraig Brady <P@draigBrady.com>
Tue, 8 Dec 2009 08:00:37 +0000 (08:00 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 8 Dec 2009 15:08:44 +0000 (15:08 +0000)
* tests/misc/stty-row-col: Linux virtual consoles at least,
issue an error if you try to increase their size, so skip the
test if we can't increase the dimensions of the tty by 1 cell.
Reported by Matthew Burgess.

tests/misc/stty-row-col

index 5efc7dd0a15c30624788db50d6b2e33fccbc0e9b..fa6556f52fb4592f021aab63dfc68e891c3d4cd7 100755 (executable)
@@ -60,6 +60,15 @@ set $tests
 saved_size=`stty size` && test -n "$saved_size" \
   || skip_test_ "can't get window size"
 
+# Linux virtual consoles issue an error if you
+# try to increase their size.  So skip in that case.
+if test "x$saved_size" != "x0 0"; then
+  srow=$(echo $saved_size | cut -d ' ' -f1)
+  scol=$(echo $saved_size | cut -d ' ' -f2)
+  stty rows $(expr $srow + 1) cols $(expr $scol + 1) ||
+    skip_test_ "can't increase window size"
+fi
+
 while :; do
   test_name=$1
   args=$2