Add “-C regress:no-ctty” option to test.sh for Fedora chroots

STRONGLY DISCOURAGED
This commit is contained in:
tg
2011-03-28 21:58:06 +00:00
parent b91b037e6a
commit a7091123aa
2 changed files with 58 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.pl,v 1.25 2011/03/28 21:15:05 tg Exp $ # $MirOS: src/bin/mksh/check.pl,v 1.26 2011/03/28 21:58:05 tg Exp $
# $OpenBSD: th,v 1.13 2006/05/18 21:27:23 miod Exp $ # $OpenBSD: th,v 1.13 2006/05/18 21:27:23 miod Exp $
#- #-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
@ -136,6 +136,8 @@
# One category os:XXX is predefined # One category os:XXX is predefined
# (XXX is the operating system name, # (XXX is the operating system name,
# eg, linux, dec_osf). # eg, linux, dec_osf).
# need-ctty 'yes' if the test needs a ctty, run
# with -C regress:no-ctty to disable.
# Flag meanings: # Flag meanings:
# r tag is required (eg, a test must have a name tag). # r tag is required (eg, a test must have a name tag).
# m value can be multiple lines. Lines must be prefixed with # m value can be multiple lines. Lines must be prefixed with
@ -194,6 +196,7 @@ EOF
'expected-stderr', 'm', 'expected-stderr', 'm',
'expected-stderr-pattern', 'm', 'expected-stderr-pattern', 'm',
'category', 'm', 'category', 'm',
'need-ctty', '',
); );
# Filled in by read_test() # Filled in by read_test()
%internal_test_fields = ( %internal_test_fields = (
@ -643,6 +646,7 @@ category_check
local(*test) = @_; local(*test) = @_;
local($c); local($c);
return 0 if ($test{'need-ctty'} && defined $categories{'regress:no-ctty'});
return 1 if (!defined $test{'category'}); return 1 if (!defined $test{'category'});
local($ok) = 0; local($ok) = 0;
foreach $c (split(',', $test{'category'})) { foreach $c (split(',', $test{'category'})) {
@ -1065,6 +1069,16 @@ read_test
} else { } else {
$test{'expected-fail'} = 0; $test{'expected-fail'} = 0;
} }
if (defined $test{'need-ctty'}) {
if ($test{'need-ctty'} !~ /^(yes|no)$/) {
print STDERR
"$prog:$test{':long-name'}: bad value for need-ctty field\n";
return undef;
}
$test{'need-ctty'} = $1 eq 'yes';
} else {
$test{'need-ctty'} = 0;
}
if (defined $test{'arguments'}) { if (defined $test{'arguments'}) {
local($firstc) = substr($test{'arguments'}, 0, 1); local($firstc) = substr($test{'arguments'}, 0, 1);

44
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.441 2011/03/28 21:30:59 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.442 2011/03/28 21:58:06 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -1013,6 +1013,7 @@ file-setup: file 644 "foo"
XXX=_ XXX=_
PS1=X PS1=X
false && echo hmmm false && echo hmmm
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
echo hi${XXX}there echo hi${XXX}there
@ -2486,6 +2487,7 @@ expected-stdout:
name: history-basic name: history-basic
description: description:
See if we can test history at all See if we can test history at all
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2502,6 +2504,7 @@ expected-stderr-pattern:
name: history-dups name: history-dups
description: description:
Verify duplicates and spaces are not entered Verify duplicates and spaces are not entered
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2522,6 +2525,7 @@ expected-stderr-pattern:
name: history-unlink name: history-unlink
description: description:
Check if broken HISTFILEs do not cause trouble Check if broken HISTFILEs do not cause trouble
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=foo/hist.file! env-setup: !ENV=./Env!HISTFILE=foo/hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2544,6 +2548,7 @@ expected-stderr-pattern:
name: history-e-minus-1 name: history-e-minus-1
description: description:
Check if more recent command is executed Check if more recent command is executed
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2563,6 +2568,7 @@ name: history-e-minus-2
description: description:
Check that repeated command is printed before command Check that repeated command is printed before command
is re-executed. is re-executed.
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2582,6 +2588,7 @@ description:
fc -e - fails when there is no history fc -e - fails when there is no history
(ksh93 has a bug that causes this to fail) (ksh93 has a bug that causes this to fail)
(ksh88 loops on this) (ksh88 loops on this)
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2597,6 +2604,7 @@ expected-stderr-pattern:
name: history-e-minus-4 name: history-e-minus-4
description: description:
Check if "fc -e -" command output goes to stdout. Check if "fc -e -" command output goes to stdout.
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2615,6 +2623,7 @@ expected-stderr-pattern:
name: history-e-minus-5 name: history-e-minus-5
description: description:
fc is replaced in history by new command. fc is replaced in history by new command.
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2640,6 +2649,7 @@ name: history-list-1
description: description:
List lists correct range List lists correct range
(ksh88 fails 'cause it lists the fc command) (ksh88 fails 'cause it lists the fc command)
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2663,6 +2673,7 @@ description:
Lists oldest history if given pre-historic number Lists oldest history if given pre-historic number
(ksh93 has a bug that causes this to fail) (ksh93 has a bug that causes this to fail)
(ksh88 fails 'cause it lists the fc command) (ksh88 fails 'cause it lists the fc command)
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2685,6 +2696,7 @@ expected-stderr-pattern:
name: history-list-3 name: history-list-3
description: description:
Can give number 'options' to fc Can give number 'options' to fc
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2708,6 +2720,7 @@ expected-stderr-pattern:
name: history-list-4 name: history-list-4
description: description:
-1 refers to previous command -1 refers to previous command
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2730,6 +2743,7 @@ expected-stderr-pattern:
name: history-list-5 name: history-list-5
description: description:
List command stays in history List command stays in history
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2756,6 +2770,7 @@ name: history-list-6
description: description:
HISTSIZE limits about of history kept. HISTSIZE limits about of history kept.
(ksh88 fails 'cause it lists the fc command) (ksh88 fails 'cause it lists the fc command)
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file!HISTSIZE=3! env-setup: !ENV=./Env!HISTFILE=hist.file!HISTSIZE=3!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2781,6 +2796,7 @@ expected-stderr-pattern:
name: history-list-7 name: history-list-7
description: description:
fc allows too old/new errors in range specification fc allows too old/new errors in range specification
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file!HISTSIZE=3! env-setup: !ENV=./Env!HISTFILE=hist.file!HISTSIZE=3!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2807,6 +2823,7 @@ expected-stderr-pattern:
name: history-list-r-1 name: history-list-r-1
description: description:
test -r flag in history test -r flag in history
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2833,6 +2850,7 @@ expected-stderr-pattern:
name: history-list-r-2 name: history-list-r-2
description: description:
If first is newer than last, -r is implied. If first is newer than last, -r is implied.
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2859,6 +2877,7 @@ expected-stderr-pattern:
name: history-list-r-3 name: history-list-r-3
description: description:
If first is newer than last, -r is cancelled. If first is newer than last, -r is cancelled.
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2885,6 +2904,7 @@ expected-stderr-pattern:
name: history-subst-1 name: history-subst-1
description: description:
Basic substitution Basic substitution
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2903,6 +2923,7 @@ expected-stderr-pattern:
name: history-subst-2 name: history-subst-2
description: description:
Does subst find previous command? Does subst find previous command?
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2921,6 +2942,7 @@ expected-stderr-pattern:
name: history-subst-3 name: history-subst-3
description: description:
Does subst find previous command when no arguments given Does subst find previous command when no arguments given
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2940,6 +2962,7 @@ name: history-subst-4
description: description:
Global substitutions work Global substitutions work
(ksh88 and ksh93 do not have -g option) (ksh88 and ksh93 do not have -g option)
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2957,6 +2980,7 @@ name: history-subst-5
description: description:
Make sure searches don't find current (fc) command Make sure searches don't find current (fc) command
(ksh88/ksh93 don't have the ? prefix thing so they fail this test) (ksh88/ksh93 don't have the ? prefix thing so they fail this test)
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -2978,6 +3002,7 @@ description:
that prints no prompts). This is for oldish ed(1) which write that prints no prompts). This is for oldish ed(1) which write
the character count to stdout. the character count to stdout.
category: stdout-ed category: stdout-ed
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -3000,6 +3025,7 @@ name: history-ed-2-old
description: description:
Correct command is edited when number given Correct command is edited when number given
category: stdout-ed category: stdout-ed
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -3031,6 +3057,7 @@ description:
(NOTE: adjusted for COMPLEX HISTORY compile time option) (NOTE: adjusted for COMPLEX HISTORY compile time option)
(ksh88 fails 'cause it lists the fc command) (ksh88 fails 'cause it lists the fc command)
category: stdout-ed category: stdout-ed
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -3062,6 +3089,7 @@ description:
Basic (ed) editing works (assumes you have generic ed editor Basic (ed) editing works (assumes you have generic ed editor
that prints no prompts). This is for newish ed(1) and stderr. that prints no prompts). This is for newish ed(1) and stderr.
category: !no-stderr-ed category: !no-stderr-ed
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -3082,6 +3110,7 @@ name: history-ed-2
description: description:
Correct command is edited when number given Correct command is edited when number given
category: !no-stderr-ed category: !no-stderr-ed
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -3109,6 +3138,7 @@ description:
Newly created multi line commands show up as single command Newly created multi line commands show up as single command
in history. in history.
category: !no-stderr-ed category: !no-stderr-ed
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -3305,6 +3335,7 @@ description:
Syntax errors in expressions and effects on bases Syntax errors in expressions and effects on bases
(interactive so errors don't cause exits) (interactive so errors don't cause exits)
(ksh88 fails this test - shell exits, even with -i) (ksh88 fails this test - shell exits, even with -i)
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
PS1= # minimise prompt hassles PS1= # minimise prompt hassles
@ -4323,6 +4354,7 @@ file-setup: file 644 "env"
PS1=Y PS1=Y
PS2=X PS2=X
env-setup: !ENV=./env! env-setup: !ENV=./env!
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
alias foo='echo hi ; ' alias foo='echo hi ; '
@ -4353,6 +4385,7 @@ file-setup: file 644 "env"
file-setup: file 644 "abc" file-setup: file 644 "abc"
stuff stuff
env-setup: !ENV=./env! env-setup: !ENV=./env!
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
sed 's/^/X /' < ab* sed 's/^/X /' < ab*
@ -4956,6 +4989,7 @@ expected-stdout:
name: xxx-exec-1 name: xxx-exec-1
description: description:
Check that exec exits for built-ins Check that exec exits for built-ins
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
exec echo hi exec echo hi
@ -5003,6 +5037,7 @@ expected-stdout:
name: xxx-status-1 name: xxx-status-1
description: description:
Check that blank lines don't clear $? Check that blank lines don't clear $?
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
(exit 1) (exit 1)
@ -5380,6 +5415,7 @@ description:
Part 2: verify mkshrc can be read (interactive shells) Part 2: verify mkshrc can be read (interactive shells)
file-setup: file 644 ".mkshrc" file-setup: file 644 ".mkshrc"
FNORD=42 FNORD=42
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !HOME=.!ENV=!PS1=! env-setup: !HOME=.!ENV=!PS1=!
stdin: stdin:
@ -5539,6 +5575,7 @@ name: persist-history-1
description: description:
Check if persistent history saving works Check if persistent history saving works
category: !no-histfile category: !no-histfile
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env!HISTFILE=hist.file! env-setup: !ENV=./Env!HISTFILE=hist.file!
file-setup: file 644 "Env" file-setup: file 644 "Env"
@ -5709,6 +5746,7 @@ description:
-UMKSH_ASSUME_UTF8 => not expected, but if your OS is old, -UMKSH_ASSUME_UTF8 => not expected, but if your OS is old,
try passing HAVE_SETLOCALE_CTYPE=0 to Build.sh try passing HAVE_SETLOCALE_CTYPE=0 to Build.sh
category: !os:hpux category: !os:hpux
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !PS1=!PS2=!LC_CTYPE=en_US.UTF-8! env-setup: !PS1=!PS2=!LC_CTYPE=en_US.UTF-8!
stdin: stdin:
@ -5727,6 +5765,7 @@ description:
Check that the utf8-mode flag is set at interactive startup Check that the utf8-mode flag is set at interactive startup
Expected failure if -DMKSH_ASSUME_UTF8=0 Expected failure if -DMKSH_ASSUME_UTF8=0
category: os:hpux category: os:hpux
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !PS1=!PS2=!LC_CTYPE=en_US.utf8! env-setup: !PS1=!PS2=!LC_CTYPE=en_US.utf8!
stdin: stdin:
@ -8043,6 +8082,7 @@ file-setup: file 755 "falsetto"
file-setup: file 755 "!false" file-setup: file 755 "!false"
#! /bin/sh #! /bin/sh
echo si echo si
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
export PATH=.:$PATH export PATH=.:$PATH
@ -8071,6 +8111,7 @@ file-setup: file 755 "falsetto"
file-setup: file 755 "!" file-setup: file 755 "!"
#! /bin/sh #! /bin/sh
echo si echo si
need-ctty: yes
arguments: !-i! arguments: !-i!
stdin: stdin:
export PATH=.:$PATH export PATH=.:$PATH
@ -8097,6 +8138,7 @@ file-setup: file 755 "falsetto"
file-setup: file 755 "!" file-setup: file 755 "!"
#! /bin/sh #! /bin/sh
echo si echo si
need-ctty: yes
arguments: !-i! arguments: !-i!
env-setup: !ENV=./Env! env-setup: !ENV=./Env!
file-setup: file 644 "Env" file-setup: file 644 "Env"