mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-02-18 22:00:55 +01:00
35760: Add ZTST_skip to test system
This commit is contained in:
parent
2833299312
commit
9152ff3b46
5 changed files with 64 additions and 31 deletions
|
@ -1,3 +1,9 @@
|
|||
2015-07-10 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 35760: Test/A01grammar.ztst, Test/C02cond.ztst,
|
||||
Test/V09datetime.ztst, Test/ztst.zsh: ZTST_skip
|
||||
can be used to skip test case.
|
||||
|
||||
2015-07-09 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 35708: Doc/Zsh/zle.yo, Src/Zle/zle_params.c,
|
||||
|
|
|
@ -13,6 +13,19 @@
|
|||
#
|
||||
# Tests for `Simple Commands and Pipelines'
|
||||
#
|
||||
|
||||
# Test skipping early to ensure we run the remainder...
|
||||
if [[ -n $ZTST_test_skip ]]; then
|
||||
ZTST_skip="Test system verification for skipping"
|
||||
else
|
||||
print "This is standard output"
|
||||
print "This is standard error" >&2
|
||||
false
|
||||
fi
|
||||
1:Test skipping if ZTST_test_skip is set
|
||||
>This is standard output
|
||||
?This is standard error
|
||||
|
||||
echo foo | cat | sed 's/foo/bar/'
|
||||
0:Basic pipeline handling
|
||||
>bar
|
||||
|
|
|
@ -151,14 +151,11 @@
|
|||
cat $unmodified
|
||||
touch $newnewnew
|
||||
if [[ $OSTYPE == "cygwin" ]]; then
|
||||
print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported on Cygwin)"
|
||||
true
|
||||
ZTST_skip="[[ -N file ]] not supported on Cygwin"
|
||||
elif (( isnfs )); then
|
||||
print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with NFS)"
|
||||
true
|
||||
ZTST_skip="[[ -N file ]] not supported with NFS"
|
||||
elif test -f /etc/mtab && { grep $(df . 2>/dev/null| tail -n1 | awk '{print $1}') /etc/mtab | grep -q noatime; }; then
|
||||
print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with noatime file system)"
|
||||
true
|
||||
ZTST_skip="[[ -N file ]] not supported with noatime file system"
|
||||
else
|
||||
[[ -N $newnewnew && ! -N $unmodified ]]
|
||||
fi
|
||||
|
|
|
@ -10,11 +10,9 @@
|
|||
TZ=UTC+0
|
||||
if [[ "$(strftime %04y 1)" = "0070" ]]; then
|
||||
[[ "$(LC_TIME=ja_JP.UTF-8 strftime %OS 1)" = 一 ]] || {
|
||||
print -u $ZTST_fd "Not testing alternate date format extensions (missing ja_JP.UTF-8 locale)"
|
||||
skip_japanese=1
|
||||
}
|
||||
else
|
||||
print -u $ZTST_fd "Skipping strftime extension tests"
|
||||
skip_extensions=1
|
||||
fi
|
||||
|
||||
|
@ -36,29 +34,37 @@
|
|||
>6_6_3_3
|
||||
>000000
|
||||
|
||||
[[ $skip_japanese = 1 ]] && repeat 5; do echo skipped; done || (
|
||||
LC_TIME=ja_JP.UTF-8
|
||||
strftime %Ey 1000000000
|
||||
strftime %Oy 1000000000
|
||||
strftime %Ex 1000000000
|
||||
strftime %OS 1000000000
|
||||
strftime %03Ey 650000000
|
||||
)
|
||||
if [[ $skip_japanese = 1 ]]; then
|
||||
ZTST_skip="Japanese UTF-8 locale not supported"
|
||||
else
|
||||
(
|
||||
LC_TIME=ja_JP.UTF-8
|
||||
strftime %Ey 1000000000
|
||||
strftime %Oy 1000000000
|
||||
strftime %Ex 1000000000
|
||||
strftime %OS 1000000000
|
||||
strftime %03Ey 650000000
|
||||
)
|
||||
fi
|
||||
0:alternate format extensions
|
||||
*>skipped|13
|
||||
>skipped|一
|
||||
>skipped|平成13年09月09日
|
||||
>skipped|四十
|
||||
>skipped|002
|
||||
>13
|
||||
>一
|
||||
>平成13年09月09日
|
||||
>四十
|
||||
>002
|
||||
|
||||
[[ $skip_extensions = 1 ]] && repeat 4; do echo skipped; done || (
|
||||
strftime '%#A' 0
|
||||
strftime '%^_10B' 0
|
||||
strftime %03Ey 650000000
|
||||
strftime %-Oe 0
|
||||
)
|
||||
if [[ $skip_extensions = 1 ]]; then
|
||||
ZTST_skip="strftime extensions not supported"
|
||||
else
|
||||
(
|
||||
strftime '%#A' 0
|
||||
strftime '%^_10B' 0
|
||||
strftime %03Ey 650000000
|
||||
strftime %-Oe 0
|
||||
)
|
||||
fi
|
||||
0:various extensions
|
||||
*>skipped|THURSDAY
|
||||
>skipped| JANUARY
|
||||
>skipped|090
|
||||
>skipped|1
|
||||
>THURSDAY
|
||||
> JANUARY
|
||||
>090
|
||||
>1
|
||||
|
|
|
@ -343,6 +343,7 @@ ZTST_diff() {
|
|||
ZTST_test() {
|
||||
local last match mbegin mend found substlines
|
||||
local diff_out diff_err
|
||||
local ZTST_skip
|
||||
|
||||
while true; do
|
||||
rm -f $ZTST_in $ZTST_out $ZTST_err
|
||||
|
@ -427,6 +428,16 @@ $ZTST_curline"
|
|||
|
||||
ZTST_execchunk <$ZTST_in >$ZTST_tout 2>$ZTST_terr
|
||||
|
||||
if [[ -n $ZTST_skip ]]; then
|
||||
ZTST_verbose 0 "Test case skipped: $ZTST_skip"
|
||||
ZTST_skip=
|
||||
if [[ -n $last ]]; then
|
||||
break
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# First check we got the right status, if specified.
|
||||
if [[ $ZTST_xstatus != - && $ZTST_xstatus != $ZTST_status ]]; then
|
||||
ZTST_testfailed "bad status $ZTST_status, expected $ZTST_xstatus from:
|
||||
|
|
Loading…
Reference in a new issue