mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
Regress tests: keep common code in one place
src/cmd/ksh93/tests/_common: - Added. This keeps one common version of 'err_exit', 'warning', and other init code. src/cmd/ksh93/tests/*.sh: - Source _common as a dot script. - Remove 50-odd, occasionally slightly different, versions of the common code. - Some minor tweaks.
This commit is contained in:
parent
6f709122c7
commit
aed5c6d70a
53 changed files with 101 additions and 596 deletions
31
src/cmd/ksh93/tests/_common
Normal file
31
src/cmd/ksh93/tests/_common
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# This file is part of the ksh 93u+m package #
|
||||||
|
# Copyright (c) 1982-2012 AT&T Intellectual Property #
|
||||||
|
# Copyright (c) 2021 Contributors to ksh 93u+m #
|
||||||
|
# <https://github.com/ksh93/ksh> #
|
||||||
|
# and is licensed under the #
|
||||||
|
# Eclipse Public License, Version 1.0 #
|
||||||
|
# #
|
||||||
|
# A copy of the License is available at #
|
||||||
|
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||||
|
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||||
|
# #
|
||||||
|
# Martijn Dekker <martijn@inlv.org> #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
_message()
|
||||||
|
{
|
||||||
|
print -r $'\t'"${Command}[$1]: ${@:2}" >&2
|
||||||
|
}
|
||||||
|
alias err_exit='_message "$((Errors++,LINENO))"' # inaccurate err_exit name kept for historical integrity :)
|
||||||
|
alias warning='_message "$LINENO" "warning:"'
|
||||||
|
|
||||||
|
Command=${0##*/}
|
||||||
|
integer Errors=0
|
||||||
|
|
||||||
|
if ! [[ -d $tmp && -w $tmp && $tmp == "$PWD" ]]
|
||||||
|
then print -r "$Command: \$tmp not set; run this from shtests. Aborting." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
alias foo='print hello'
|
alias foo='print hello'
|
||||||
if [[ $(foo) != hello ]]
|
if [[ $(foo) != hello ]]
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
{
|
{
|
||||||
x=abc
|
x=abc
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
trap '' FPE # NOTE: osf.alpha requires this (no ieee math)
|
trap '' FPE # NOTE: osf.alpha requires this (no ieee math)
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
function fun
|
function fun
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
for ((i=0; i < 4; i++ ))
|
for ((i=0; i < 4; i++ ))
|
||||||
do for ((j=0; j < 5; j++ ))
|
do for ((j=0; j < 5; j++ ))
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
# ======
|
# ======
|
||||||
# as of 93u+, typeset -xu/-xl failed to change case in a value (rhbz#1188377)
|
# as of 93u+, typeset -xu/-xl failed to change case in a value (rhbz#1188377)
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
bincat=$(whence -p cat)
|
bincat=$(whence -p cat)
|
||||||
binecho=$(whence -p echo)
|
binecho=$(whence -p echo)
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
null=''
|
null=''
|
||||||
if [[ ! -z $null ]]
|
if [[ ! -z $null ]]
|
||||||
|
@ -83,7 +73,7 @@ fi
|
||||||
chmod 000 $file
|
chmod 000 $file
|
||||||
|
|
||||||
if [[ $(id -u) == '0' ]]
|
if [[ $(id -u) == '0' ]]
|
||||||
then print -u2 "\t${Command}[$LINENO]: warning: running as root: skipping tests involving r/w permissions"
|
then warning "running as root: skipping tests involving r/w permissions"
|
||||||
else if [[ -r $file ]]
|
else if [[ -r $file ]]
|
||||||
then err_exit "-r: $file should not be readable"
|
then err_exit "-r: $file should not be readable"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
bincat=$(whence -p cat)
|
bincat=$(whence -p cat)
|
||||||
|
|
||||||
|
@ -808,7 +798,7 @@ e=$?
|
||||||
|
|
||||||
# https://bugzilla.redhat.com/1102627
|
# https://bugzilla.redhat.com/1102627
|
||||||
if [[ $(id -u) == '0' ]]
|
if [[ $(id -u) == '0' ]]
|
||||||
then print -u2 "\t${Command}[$LINENO]: warning: running as root: skipping tests involving directory search (x) permission"
|
then warning "running as root: skipping tests involving directory search (x) permission"
|
||||||
else
|
else
|
||||||
mkdir -m 600 "$tmp/no_x_dir"
|
mkdir -m 600 "$tmp/no_x_dir"
|
||||||
expect=": cd: $tmp/no_x_dir: [Permission denied]"
|
expect=": cd: $tmp/no_x_dir: [Permission denied]"
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
bar=foo2
|
bar=foo2
|
||||||
bam=foo[3]
|
bam=foo[3]
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
#test for compound variables
|
#test for compound variables
|
||||||
Command=${0##*/}
|
Command=${0##*/}
|
||||||
|
|
|
@ -19,20 +19,7 @@
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
# test setup
|
. "${0%/*}/_common"
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n '\t'
|
|
||||||
print -u2 -r "${Command}[$1]: ${@:2}"
|
|
||||||
(( Errors++ ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
alias warning='err\_exit $((Errors--,LINENO)) warning:'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
# "nounset" disabled for now
|
# "nounset" disabled for now
|
||||||
#set -o nounset
|
#set -o nounset
|
||||||
|
|
|
@ -18,18 +18,8 @@
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
# test the behavior of co-processes
|
# test the behavior of co-processes
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
if [[ -d /cygdrive ]]
|
if [[ -d /cygdrive ]]
|
||||||
then err_exit cygwin detected - coprocess tests disabled - enable at the risk of wedging your system
|
then err_exit cygwin detected - coprocess tests disabled - enable at the risk of wedging your system
|
||||||
|
|
|
@ -17,20 +17,11 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
integer n=2
|
integer n=2
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
typeset -T Box_t=(
|
typeset -T Box_t=(
|
||||||
float -h 'height in inches' x=2
|
float -h 'height in inches' x=2
|
||||||
float -h 'width in inches' y=4
|
float -h 'width in inches' y=4
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
enum Color_t=(red green blue orange yellow)
|
enum Color_t=(red green blue orange yellow)
|
||||||
enum -i Sex_t=(Male Female)
|
enum -i Sex_t=(Male Female)
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
function abspath
|
function abspath
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,17 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$Line]: "$@"
|
|
||||||
((Errors++))
|
|
||||||
}
|
|
||||||
|
|
||||||
integer Errors=0
|
. "${0%/*}/_common"
|
||||||
Command=${0##*/}
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
# {...} expansion tests -- ignore if not supported
|
# {...} expansion tests -- ignore if not supported
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
integer Errors=0
|
. "${0%/*}/_common"
|
||||||
Command=${0##*/}
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
compiled=''
|
compiled=''
|
||||||
read -n4 c < $0 2> /dev/null
|
read -n4 c < $0 2> /dev/null
|
||||||
|
|
|
@ -17,17 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -r $'\t'"${Command}[$1] ${@:2}"
|
|
||||||
((Errors++))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer aware=0 contrary=0 Errors=0 ignorant=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
function test_glob
|
function test_glob
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
function grep
|
function grep
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
bincat=$(whence -p cat)
|
bincat=$(whence -p cat)
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
unset HISTFILE
|
unset HISTFILE
|
||||||
|
|
||||||
|
|
|
@ -13,19 +13,8 @@
|
||||||
# Martijn Dekker <martijn@inlv.org> #
|
# Martijn Dekker <martijn@inlv.org> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r "${Command}[$1]: ${@:2}"
|
|
||||||
let Errors++
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
alias warning='err\_exit $((Errors--,LINENO)) warning:'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
# All the tests here should run with job control on
|
# All the tests here should run with job control on
|
||||||
set -o monitor
|
set -o monitor
|
||||||
|
|
|
@ -18,19 +18,7 @@
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
function err_exit
|
. "${0%/*}/_common"
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
|
|
||||||
# Determine method for running tests.
|
# Determine method for running tests.
|
||||||
# The 'vmstate' builtin can be used if ksh was compiled with vmalloc.
|
# The 'vmstate' builtin can be used if ksh was compiled with vmalloc.
|
||||||
|
@ -75,7 +63,7 @@ then N=16384
|
||||||
{
|
{
|
||||||
ps -o rss= -p "$$"
|
ps -o rss= -p "$$"
|
||||||
}
|
}
|
||||||
else err\_exit "$LINENO" 'WARNING: cannot find method to measure memory usage; skipping tests'
|
else warning 'cannot find method to measure memory usage; skipping tests'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
unset LANG LANGUAGE "${!LC_@}"
|
unset LANG LANGUAGE "${!LC_@}"
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors < 127 && Errors++ ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
function checkref
|
function checkref
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,21 +17,11 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
if((!SHOPT_NAMESPACE))
|
if((!SHOPT_NAMESPACE))
|
||||||
then err\_exit "$LINENO" 'warning: shell compiled without SHOPT_NAMESPACE; skipping tests'
|
then warning 'shell compiled without SHOPT_NAMESPACE; skipping tests'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
unset HISTFILE
|
unset HISTFILE
|
||||||
export LC_ALL=C ENV=/./dev/null
|
export LC_ALL=C ENV=/./dev/null
|
||||||
|
|
|
@ -17,19 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
alias warning='err\_exit $((Errors--,LINENO)) warning:'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
# to avoid spurious test failures with 'whence -a' tests, we need
|
# to avoid spurious test failures with 'whence -a' tests, we need
|
||||||
# to remove any duplicate paths to the same directory from $PATH.
|
# to remove any duplicate paths to the same directory from $PATH.
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
typeset -T Pt_t=(
|
typeset -T Pt_t=(
|
||||||
float x=1
|
float x=1
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
: : generated by mkptytests from "posix-sh-*-c.pty" : :
|
|
||||||
|
. "${0%/*}/_common"
|
||||||
|
|
||||||
# These are tests for the interactive shell, run in a pseudoterminal utility
|
# These are tests for the interactive shell, run in a pseudoterminal utility
|
||||||
# called 'pty', which allows for scripting interactive sessions and which is
|
# called 'pty', which allows for scripting interactive sessions and which is
|
||||||
|
@ -31,22 +32,7 @@
|
||||||
# the trickiest part of the tests is avoiding typeahead
|
# the trickiest part of the tests is avoiding typeahead
|
||||||
# in the pty dialogue
|
# in the pty dialogue
|
||||||
|
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors++ ))
|
|
||||||
}
|
|
||||||
|
|
||||||
alias err_exit='err_exit $lineno'
|
|
||||||
alias warning='err\_exit $((Errors--,LINENO)) warning:'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0 lineno=1
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
whence -q pty || { warning "pty command not found -- tests skipped"; exit 0; }
|
whence -q pty || { warning "pty command not found -- tests skipped"; exit 0; }
|
||||||
|
|
||||||
case $(uname -s) in
|
case $(uname -s) in
|
||||||
Darwin | FreeBSD | Linux )
|
Darwin | FreeBSD | Linux )
|
||||||
;;
|
;;
|
||||||
|
@ -54,6 +40,8 @@ Darwin | FreeBSD | Linux )
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
integer lineno=1
|
||||||
|
|
||||||
# On some systems, the stty command does not appear to work correctly on a pty pseudoterminal.
|
# On some systems, the stty command does not appear to work correctly on a pty pseudoterminal.
|
||||||
# To avoid false regressions, we have to set 'erase' and 'kill' on the real terminal.
|
# To avoid false regressions, we have to set 'erase' and 'kill' on the real terminal.
|
||||||
if test -t 0 2>/dev/null </dev/tty && stty_restore=$(stty -g </dev/tty)
|
if test -t 0 2>/dev/null </dev/tty && stty_restore=$(stty -g </dev/tty)
|
||||||
|
@ -223,7 +211,7 @@ u ^hello\r?\n$
|
||||||
!
|
!
|
||||||
|
|
||||||
if [[ $(id -u) == 0 ]]
|
if [[ $(id -u) == 0 ]]
|
||||||
then print -u2 "\t${Command}[$LINENO]: warning: running as root: skipping test POSIX sh 096(C)"
|
then warning "running as root: skipping test POSIX sh 096(C)"
|
||||||
else
|
else
|
||||||
# err_exit #
|
# err_exit #
|
||||||
tst $LINENO <<"!"
|
tst $LINENO <<"!"
|
||||||
|
@ -268,7 +256,7 @@ u ^ok\r?\n$
|
||||||
!
|
!
|
||||||
|
|
||||||
if [[ $(id -u) == 0 ]]
|
if [[ $(id -u) == 0 ]]
|
||||||
then print -u2 "\t${Command}[$LINENO]: warning: running as root: skipping test POSIX sh 099(C)"
|
then warning "running as root: skipping test POSIX sh 099(C)"
|
||||||
else
|
else
|
||||||
# err_exit #
|
# err_exit #
|
||||||
tst $LINENO <<"!"
|
tst $LINENO <<"!"
|
||||||
|
@ -379,7 +367,7 @@ u ^done\r?\n$
|
||||||
!
|
!
|
||||||
|
|
||||||
if [[ $(id -u) == 0 ]]
|
if [[ $(id -u) == 0 ]]
|
||||||
then print -u2 "\t${Command}[$LINENO]: warning: running as root: skipping test POSIX sh 111(C)"
|
then warning "running as root: skipping test POSIX sh 111(C)"
|
||||||
else
|
else
|
||||||
# err_exit #
|
# err_exit #
|
||||||
((SHOPT_VSH)) && tst $LINENO <<"!"
|
((SHOPT_VSH)) && tst $LINENO <<"!"
|
||||||
|
@ -424,7 +412,7 @@ u ^hello world\r?\n$
|
||||||
!
|
!
|
||||||
|
|
||||||
if [[ $(id -u) == 0 ]]
|
if [[ $(id -u) == 0 ]]
|
||||||
then print -u2 "\t${Command}[$LINENO]: warning: running as root: skipping test POSIX sh 251(C)"
|
then warning "running as root: skipping test POSIX sh 251(C)"
|
||||||
else
|
else
|
||||||
# err_exit #
|
# err_exit #
|
||||||
((SHOPT_VSH)) && tst $LINENO <<"!"
|
((SHOPT_VSH)) && tst $LINENO <<"!"
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors++ ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
binecho=$(whence -p echo)
|
binecho=$(whence -p echo)
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
set -o noglob
|
set -o noglob
|
||||||
if [[ 'hi there' != "hi there" ]]
|
if [[ 'hi there' != "hi there" ]]
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
tmp1=$tmp/tmp1.csv
|
tmp1=$tmp/tmp1.csv
|
||||||
tmp2=$tmp/tmp2.csv
|
tmp2=$tmp/tmp2.csv
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
typeset -T Pt_t=(
|
typeset -T Pt_t=(
|
||||||
float x=1
|
float x=1
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
binecho=$(whence -p echo)
|
binecho=$(whence -p echo)
|
||||||
|
|
||||||
|
|
|
@ -19,18 +19,7 @@
|
||||||
########################################################################
|
########################################################################
|
||||||
# test the behavior of return and exit with functions
|
# test the behavior of return and exit with functions
|
||||||
|
|
||||||
function err_exit
|
. "${0%/*}/_common"
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
unset HISTFILE
|
unset HISTFILE
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
PS3='ABC '
|
PS3='ABC '
|
||||||
|
|
||||||
|
|
|
@ -345,9 +345,6 @@ do [[ $i == *.sh ]] || i+='.sh'
|
||||||
glob.sh) grep -c '^[[:blank:]]*test_[a-z]\{3,\}' $i ;;
|
glob.sh) grep -c '^[[:blank:]]*test_[a-z]\{3,\}' $i ;;
|
||||||
*) grep -c err_exit $i ;;
|
*) grep -c err_exit $i ;;
|
||||||
esac )
|
esac )
|
||||||
if (( t > 2 ))
|
|
||||||
then (( t = t - 2 ))
|
|
||||||
fi
|
|
||||||
tests[$i]=$t
|
tests[$i]=$t
|
||||||
T=test
|
T=test
|
||||||
if (( t != 1 ))
|
if (( t != 1 ))
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
float DELAY=${1:-0.02}
|
float DELAY=${1:-0.02}
|
||||||
integer FOREGROUND=10 BACKGROUND=2
|
integer FOREGROUND=10 BACKGROUND=2
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors++ ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
unset n s t
|
unset n s t
|
||||||
typeset -A SIG
|
typeset -A SIG
|
||||||
|
|
|
@ -21,18 +21,7 @@
|
||||||
# Written by Roland Mainz <roland.mainz@nrubsig.org>
|
# Written by Roland Mainz <roland.mainz@nrubsig.org>
|
||||||
#
|
#
|
||||||
|
|
||||||
function err_exit
|
. "${0%/*}/_common"
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors < 127 && Errors++ ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
|
|
|
@ -17,20 +17,11 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
typeset -F SECONDS # for fractional seconds in PS4
|
typeset -F SECONDS # for fractional seconds in PS4
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
builtin getconf
|
builtin getconf
|
||||||
bincat=$(PATH=$(getconf PATH) whence -p cat)
|
bincat=$(PATH=$(getconf PATH) whence -p cat)
|
||||||
binecho=$(PATH=$(getconf PATH) whence -p echo)
|
binecho=$(PATH=$(getconf PATH) whence -p echo)
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
tmpPS4='+ [temp_PS4|L$LINENO|e$?] ' # used to avoid interference to ${.sh.match} from $PS4 set by shtests
|
tmpPS4='+ [temp_PS4|L$LINENO|e$?] ' # used to avoid interference to ${.sh.match} from $PS4 set by shtests
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r $Command: "$@"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
if $SHELL -c '[[ ~root == /* ]]'
|
if $SHELL -c '[[ ~root == /* ]]'
|
||||||
then x=$(print -r -- ~root)
|
then x=$(print -r -- ~root)
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
typeset -T Time_t=(
|
typeset -T Time_t=(
|
||||||
integer .=-1
|
integer .=-1
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
# Use is subject to license terms.
|
# Use is subject to license terms.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
. "${0%/*}/_common"
|
||||||
|
|
||||||
#
|
#
|
||||||
# This test checks whether "typeset -m" correctly moves local variables
|
# This test checks whether "typeset -m" correctly moves local variables
|
||||||
# into a global variable tree.
|
# into a global variable tree.
|
||||||
|
@ -53,19 +55,6 @@
|
||||||
# -- snip --
|
# -- snip --
|
||||||
#
|
#
|
||||||
|
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
## test start
|
## test start
|
||||||
typeset -C tree1 tree2
|
typeset -C tree1 tree2
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
integer n=2
|
integer n=2
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,8 @@
|
||||||
# David Korn <dgk@research.att.com> #
|
# David Korn <dgk@research.att.com> #
|
||||||
# #
|
# #
|
||||||
########################################################################
|
########################################################################
|
||||||
function err_exit
|
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r "${Command}[$1]: ${@:2}"
|
|
||||||
let Errors+=1
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
. "${0%/*}/_common"
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
[[ ${.sh.version} == "$KSH_VERSION" ]] || err_exit '.sh.version != KSH_VERSION'
|
[[ ${.sh.version} == "$KSH_VERSION" ]] || err_exit '.sh.version != KSH_VERSION'
|
||||||
unset ss
|
unset ss
|
||||||
|
@ -747,17 +737,14 @@ unset r v x
|
||||||
Errors=$? # ensure error count survives subshell
|
Errors=$? # ensure error count survives subshell
|
||||||
(
|
(
|
||||||
errmsg=$({ LANG=bad_LOCALE; } 2>&1)
|
errmsg=$({ LANG=bad_LOCALE; } 2>&1)
|
||||||
if [[ -z $errmsg ]]
|
|
||||||
then print -u2 "\t${Command}[$LINENO]: warning: C library does not seem to verify locales: skipping LC_* tests"
|
|
||||||
exit $Errors
|
|
||||||
fi
|
|
||||||
x=x
|
x=x
|
||||||
for v in LC_ALL LC_CTYPE LC_MESSAGES LC_COLLATE LC_NUMERIC
|
for v in LC_ALL LC_CTYPE LC_MESSAGES LC_COLLATE LC_NUMERIC
|
||||||
do nameref r=$v
|
do nameref r=$v
|
||||||
unset $v
|
unset $v
|
||||||
[[ $r ]] && err_exit "unset $v failed -- expected '', got '$r'"
|
[[ $r ]] && err_exit "unset $v failed -- expected '', got '$r'"
|
||||||
d=$($SHELL -c "$v=$x" 2>&1)
|
# Test disabled: some system libraries do not verify the locale, so no diagnostic is printed.
|
||||||
[[ $d ]] || err_exit "$v=$x failed -- expected locale diagnostic"
|
#d=$($SHELL -c "$v=$x" 2>&1)
|
||||||
|
#[[ $d ]] || err_exit "$v=$x failed -- expected locale diagnostic"
|
||||||
{ g=$( r=$x; print -- $r ); } 2>/dev/null
|
{ g=$( r=$x; print -- $r ); } 2>/dev/null
|
||||||
[[ $g == '' ]] || err_exit "$v=$x failed -- expected '', got '$g'"
|
[[ $g == '' ]] || err_exit "$v=$x failed -- expected '', got '$g'"
|
||||||
{ g=$( r=C; r=$x; print -- $r ); } 2>/dev/null
|
{ g=$( r=C; r=$x; print -- $r ); } 2>/dev/null
|
||||||
|
|
|
@ -19,23 +19,12 @@
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
# variable tree test #001
|
# variable tree test #001
|
||||||
# Propose of this test is whether ksh93 handles global variable trees
|
# Purpose of this test is whether ksh93 handles global variable trees
|
||||||
# and function-local variable trees the same way, including "nameref"
|
# and function-local variable trees the same way, including "nameref"
|
||||||
# and "unset" handling.
|
# and "unset" handling.
|
||||||
#
|
#
|
||||||
|
|
||||||
function err_exit
|
. "${0%/*}/_common"
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
function build_tree
|
function build_tree
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,23 +19,12 @@
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
# variable tree test #002
|
# variable tree test #002
|
||||||
# Propose of this test is whether ksh93 handles global variable trees
|
# Purpose of this test is whether ksh93 handles global variable trees
|
||||||
# and function-local variable trees the same way, including "nameref"
|
# and function-local variable trees the same way, including "nameref"
|
||||||
# and "unset" handling.
|
# and "unset" handling.
|
||||||
#
|
#
|
||||||
|
|
||||||
function err_exit
|
. "${0%/*}/_common"
|
||||||
{
|
|
||||||
print -u2 -n "\t"
|
|
||||||
print -u2 -r ${Command}[$1]: "${@:2}"
|
|
||||||
(( Errors+=1 ))
|
|
||||||
}
|
|
||||||
alias err_exit='err_exit $LINENO'
|
|
||||||
|
|
||||||
Command=${0##*/}
|
|
||||||
integer Errors=0
|
|
||||||
|
|
||||||
[[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; }
|
|
||||||
|
|
||||||
# "built_tree1" and "built_tree2" are identical except the way how they test
|
# "built_tree1" and "built_tree2" are identical except the way how they test
|
||||||
# whether a variable exists:
|
# whether a variable exists:
|
||||||
|
|
Loading…
Reference in a new issue