From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9190 invoked by alias); 10 Jul 2015 13:37:22 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35760 Received: (qmail 13872 invoked from network); 10 Jul 2015 13:37:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f5-f794b6d000001495-97-559fca88c96c To: undisclosed-recipients: ; Date: Fri, 10 Jul 2015 14:37:08 +0100 From: Peter Stephenson Cc: Zsh Hackers' List Subject: Re: PATCH: ztrftime: Pass everything unhandled to the system strftime() Message-id: <20150710143708.71ec8178@pwslap01u.europe.root.pri> In-reply-to: <20150709111756.631dac65@pwslap01u.europe.root.pri> References: <20150709094122.17abacc8@pwslap01u.europe.root.pri> <1436435887-28736-1-git-send-email-mikachu@gmail.com> <20150709111756.631dac65@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsVy+t/xq7odp+aHGmzbL2JxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mr43XGYqeKVacWrTLLYGxlmyXYycHBICJhJ3Z7xkhLDFJC7c W8/WxcjFISSwlFFi95ZdbCAJEQEZibmzH7NCJGYwSSyZOocJwtnGKNH+tgfI4eBgEVCVeLPA HaSBTcBQYuqm2WBTmQW0JbZObWIGsYUFAiRmT9zNBGLzCthL3Gn8ALaAU8BB4uu898wQM9cy Ssx9chWsiF9AX+Lq309MEOfZS8y8coYRollQ4sfkeywQC9QlJs1bxAyz7Mm7C6wgthBQ/Mbd 3ewTGIVnIWmZhaRlFpKWBYzMqxhFU0uTC4qT0nON9IoTc4tL89L1kvNzNzFCwvnrDsalx6wO MQpwMCrx8AawzQ8VYk0sK67MPcQowcGsJMLbvQooxJuSWFmVWpQfX1Sak1p8iFGag0VJnHfm rvchQgLpiSWp2ampBalFMFkmDk6pBsZUaYM/G9cId5feKfgmvv2BD0fgszuOsVaZLnc/zjV2 dI3c3fxup9Dc5aWLVHYFOU8L9Zv5cvVCBkuR7OQI85xn3z5PzbqWZLvrU4t/zeOF1x//5ljC ZjfBPTOhzzkvJkV41f+52hsDlhlskq15VPNR/fnNHHu79iOCHlMdpBgUYwu3HdGqKlZiKc5I NNRiLipOBACctsaTYwIAAA== On Thu, 9 Jul 2015 11:17:56 +0100 Peter Stephenson wrote: > On Thu, 9 Jul 2015 11:58:07 +0200 > Mikael Magnusson wrote: > > This seems to work, I've added tests, and a comment. >=20 > OK, the printing "skipped" trick looks like it should cover all bases. > Still, it ought to be possible to make it redundant within the test > framework... e.g. pws diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 8221735..82d9c8c 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -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=3D"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 diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst index 02fa4d4..e9a596a 100644 --- a/Test/C02cond.ztst +++ b/Test/C02cond.ztst @@ -151,14 +151,11 @@ cat $unmodified touch $newnewnew if [[ $OSTYPE =3D=3D "cygwin" ]]; then - print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported on= Cygwin)" - true + ZTST_skip=3D"[[ -N file ]] not supported on Cygwin" elif (( isnfs )); then - print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported wi= th NFS)" - true + ZTST_skip=3D"[[ -N file ]] not supported with NFS" elif test -f /etc/mtab && { grep $(df . 2>/dev/null| tail -n1 | awk '{pr= int $1}') /etc/mtab | grep -q noatime; }; then - print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported wi= th noatime file system)" - true + ZTST_skip=3D"[[ -N file ]] not supported with noatime file system" else [[ -N $newnewnew && ! -N $unmodified ]] fi diff --git a/Test/V09datetime.ztst b/Test/V09datetime.ztst index a3b4e8c..a7ef983 100644 --- a/Test/V09datetime.ztst +++ b/Test/V09datetime.ztst @@ -10,11 +10,9 @@ TZ=3DUTC+0 if [[ "$(strftime %04y 1)" =3D "0070" ]]; then [[ "$(LC_TIME=3Dja_JP.UTF-8 strftime %OS 1)" =3D =E4=B8=80 ]] || { - print -u $ZTST_fd "Not testing alternate date format extensions (mis= sing ja_JP.UTF-8 locale)" skip_japanese=3D1 } else - print -u $ZTST_fd "Skipping strftime extension tests" skip_extensions=3D1 fi =20 @@ -36,29 +34,37 @@ >6_6_3_3 >000000 =20 - [[ $skip_japanese =3D 1 ]] && repeat 5; do echo skipped; done || ( - LC_TIME=3Dja_JP.UTF-8 - strftime %Ey 1000000000 - strftime %Oy 1000000000 - strftime %Ex 1000000000 - strftime %OS 1000000000 - strftime %03Ey 650000000 - ) + if [[ $skip_japanese =3D 1 ]]; then + ZTST_skip=3D"Japanese UTF-8 locale not supported" + else + ( + LC_TIME=3Dja_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|=E4=B8=80 ->skipped|=E5=B9=B3=E6=88=9013=E5=B9=B409=E6=9C=8809=E6=97=A5 ->skipped|=E5=9B=9B=E5=8D=81 ->skipped|002 +>13 +>=E4=B8=80 +>=E5=B9=B3=E6=88=9013=E5=B9=B409=E6=9C=8809=E6=97=A5 +>=E5=9B=9B=E5=8D=81 +>002 =20 - [[ $skip_extensions =3D 1 ]] && repeat 4; do echo skipped; done || ( - strftime '%#A' 0 - strftime '%^_10B' 0 - strftime %03Ey 650000000 - strftime %-Oe 0 - ) + if [[ $skip_extensions =3D 1 ]]; then + ZTST_skip=3D"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 diff --git a/Test/ztst.zsh b/Test/ztst.zsh index 74111f6..ce89a83 100755 --- a/Test/ztst.zsh +++ b/Test/ztst.zsh @@ -343,6 +343,7 @@ ZTST_diff() { ZTST_test() { local last match mbegin mend found substlines local diff_out diff_err + local ZTST_skip =20 while true; do rm -f $ZTST_in $ZTST_out $ZTST_err @@ -427,6 +428,16 @@ $ZTST_curline" =20 ZTST_execchunk <$ZTST_in >$ZTST_tout 2>$ZTST_terr =20 + if [[ -n $ZTST_skip ]]; then + ZTST_verbose 0 "Test case skipped: $ZTST_skip" + ZTST_skip=3D + if [[ -n $last ]]; then + break + else + continue + fi + fi + # First check we got the right status, if specified. if [[ $ZTST_xstatus !=3D - && $ZTST_xstatus !=3D $ZTST_status ]]; th= en ZTST_testfailed "bad status $ZTST_status, expected $ZTST_xstatus from: