bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stty & stty-row-col test failures


From: Pádraig Brady
Subject: Re: stty & stty-row-col test failures
Date: Tue, 08 Dec 2009 01:25:54 +0000
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Matthew Burgess wrote:
> On Mon, 07 Dec 2009 00:30:05 +0000, Pádraig Brady <address@hidden> wrote:
> 
>> The stty-row-col test is getting EINVAL from the system.
>> Can you try running this is a terminal to see if it does the same?
>>
>>   stty rows 40 columns 80
> 
> OK, I think I understand now.
> 
> $ stty size
> 25 80
> $ stty rows 25 columns 80
> $
> $ stty rows 26 columns 80
> stty: standard input: Invalid argument
> 
> So, I think the test is making an invalid assumption that the terminal
> is always capable of displaying 40 lines.
> 
> I'll guess at a potential solution of using the currently installed
> 'stty' to query the size first, then using those values to test the
> new version?

I can also see this issue on linux virtual consoles.
I.E. one can make them smaller but not larger.
So I'll probably commit something like the following
to skip the test on such terminals. xterms won't have
the issue and so this test will usually be run

cheers,
Pádraig.

diff --git a/tests/misc/stty-row-col b/tests/misc/stty-row-col
index 5efc7dd..7722414 100755
--- a/tests/misc/stty-row-col
+++ b/tests/misc/stty-row-col
@@ -60,6 +60,11 @@ set $tests
 saved_size=`stty size` && test -n "$saved_size" \
   || skip_test_ "can't get window size"

+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"
+
 while :; do
   test_name=$1
   args=$2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]