From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18439 invoked by alias); 22 Nov 2015 07:51:56 -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: 37181 Received: (qmail 13194 invoked from network); 22 Nov 2015 07:51:52 -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=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type:content-transfer-encoding; bh=ey9PmmAwLsyDKWG2/8OYzSpcQl9IZrdU6Ns/SzpSru8=; b=vH6kcD8bi1WjRAq5bYUyKupT9FHT99bG23B/vg4xHzb+okChtIcAn5FgELbTuCortf cvng24UL+rfYx7lzA1KV82blGDl6+Pinlg1SaZljIk4xEH1+t8ftBfLFfms1RxPX+h7t 9dqwO6GvCtYeD5QT7tHkC0XUt9qlrj0qrhRE20G1fUBPpnAlEhjsv1FtOMiL3Uv16tI0 gitoL8wbtjJ2yTSwpVX/Q3/bvYnTy5BJs7uZqlxDKFS7RIM94cxEQ3fyDOd/JOSpAyZH eMipkRu/2C6qgmWkPVcigZx3mXe9kDkVfMQ9V87KVg3pF18b5Y2IaQN6ar0yaleM7WPl EG8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type :content-transfer-encoding; bh=ey9PmmAwLsyDKWG2/8OYzSpcQl9IZrdU6Ns/SzpSru8=; b=GEwyT5yzPkpdCsvFNv023eKw8ag+JmgrCYAPHP3fjX+A1gMKCHBioA4nkP8HdrCSQn 6xgxxnwaRplpZFr4+qHLZl476ofQoQLMNF+ymi6PsNq3LHDOyodLp7n3OxhRZmIrLf1J DCiCEsGh/uMLsUNEO1yNXzzLjdQwXJJy8ecM/dVWrRQ0Q+YyUEpFqgcjA9Jlyg3a9PN2 N5HL/WJ/3/3TRhdh9p3NY+mJC89GiPjqgZUAQGYvgNYpu+UTAc2GMLfzGIJL2E4VKY4x b0TVKTge1NJTe1UnYvKWQe0k0EBYojhoK0H0ZbeuCX2ll91WVZys9MLSwZcWEp9i0y+H Qvcw== X-Gm-Message-State: ALoCoQmc6xwUKPFoHHatFCON8VjcySuC9AMWw1k2XaviPWzYR7BqLG8YGh9mTMl+/mq8if3BwWpj X-Received: by 10.68.139.67 with SMTP id qw3mr29452963pbb.93.1448178710072; Sat, 21 Nov 2015 23:51:50 -0800 (PST) From: Bart Schaefer Message-Id: <151121235156.ZM335@torch.brasslantern.com> Date: Sat, 21 Nov 2015 23:51:56 -0800 In-Reply-To: <151121171456.ZM17449@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Test/V01private.ztst skipped (was: zsh 5.1.1-test-1)" (Nov 21, 5:14pm) References: <20151121183514.527eccf6@ntlworld.com> <20151121230142.GE2335@tarsus.local2> <151121171456.ZM17449@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: Test/V01private.ztst skipped (was: zsh 5.1.1-test-1) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable On Nov 21, 5:14pm, Bart Schaefer wrote: } } So obviously the 2>/dev/null is in the wrong place. }=20 } No response to my grumbling in workers/37086 ... I went through all the tests that use zmodload, forced zmodload to fail by copying /dev/null on top of the corresponding .so file, and then checked the output of the test. The following patch makes all tests as consistent as context permits. This replaces 37178. "make check" passes all with these changes.=20 One interesting point: If zsh/datetime cannot be loaded, we don't test any of the "features" functionality in V04features.ztst. Should this be considered failure rather than unimplemented? I left it as it was for now. diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst index e9a596a..40bbf42 100644 --- a/Test/C02cond.ztst +++ b/Test/C02cond.ztst @@ -257,7 +257,7 @@ F:Failures in these cases do not indicate a problem in = the shell. >status =3D 1 =20 # core dumps on failure - if zmodload -i zsh/regex 2>/dev/null; then + if zmodload zsh/regex 2>/dev/null; then echo >regex_test.sh 'if [[ $# =3D 1 ]]; then if [[ $1 =3D~ /?[^/]+:[0-9]+:$ ]]; then : @@ -268,7 +268,8 @@ F:Failures in these cases do not indicate a problem in = the shell. fi 0:regex tests shouldn't crash =20 - (if zmodload -i zsh/regex 2>/dev/null; then + if zmodload zsh/regex 2>/dev/null; then + ( # subshell in case coredump test failed string=3D"this has stuff in it" bad_regex=3D0 if [[ $string =3D~ "h([a-z]*) s([a-z]*) " ]]; then @@ -295,23 +296,26 @@ F:Failures in these cases do not indicate a problem i= n the shell. else print -r "regex failed to match '$string'" fi + ) else # if it didn't load, tough, but not a test error - print OK - fi) + ZTST_skip=3D"regexp library not found." + fi 0:MATCH, MBEGIN, MEND, match, mbegin, mend >OK =20 - (if zmodload -i zsh/regex 2>/dev/null; then + if zmodload zsh/regex 2>/dev/null; then + ( # subshell because regex module may dump core, see above if [[ a =3D~ a && b =3D=3D b ]]; then print OK else print "regex =3D~ inverted following test" fi + ) else # not a test error - print OK - fi) + ZTST_skip=3D"regexp library not found." + fi 0:regex infix operator should not invert following conditions >OK =20 diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst index dff2ec1..f95c06d 100644 --- a/Test/D07multibyte.ztst +++ b/Test/D07multibyte.ztst @@ -500,7 +500,7 @@ # aren't quite double width, but the arithmetic is correct. # It appears just to be an effect of the font. =20 - if zmodload -i zsh/regex 2>/dev/null; then + if zmodload zsh/regex 2>/dev/null; then [[ $'\ua0' =3D~ '^.$' ]] && print OK [[ $'\ua0' =3D~ $'^\ua0$' ]] && print OK [[ $'\ua0'X =3D~ '^X$' ]] || print OK diff --git a/Test/V01zmodload.ztst b/Test/V01zmodload.ztst index 3580bac..349ae9c 100644 --- a/Test/V01zmodload.ztst +++ b/Test/V01zmodload.ztst @@ -52,7 +52,7 @@ >zmodload zsh/main >zmodload zsh/parameter =20 -# You use to need zmodload -i to avoid an error. +# You used to need zmodload -i to avoid an error. # That has been deemed pointless, so now an attempt # to load a loaded module should succeed. zmodload zsh/main @@ -64,7 +64,7 @@ =20 for m in $mods do - zmodload -i $m || mods[(r)$m]=3D() + zmodload $m || mods[(r)$m]=3D() done 0d:Test loading of all compiled modules =20 @@ -74,7 +74,7 @@ # Now check for proper failure conditions by trying some operations on # a nonexistent module. =20 - zmodload -i bogus/notamodule + zmodload bogus/notamodule 1D:Check that loading a nonexistent module fails =20 zmodload -u bogus/notamodule diff --git a/Test/V02zregexparse.ztst b/Test/V02zregexparse.ztst index ddca3c9..b4cec42 100644 --- a/Test/V02zregexparse.ztst +++ b/Test/V02zregexparse.ztst @@ -2,7 +2,9 @@ =20 %prep =20 - zmodload zsh/zutil + if ! zmodload zsh/zutil 2>/dev/null; then + ZTST_unimplemented=3D"can't load the zsh/zutil module for testing" + fi =20 %test =20 diff --git a/Test/V03mathfunc.ztst b/Test/V03mathfunc.ztst index ab383db..1edb7a2 100644 --- a/Test/V03mathfunc.ztst +++ b/Test/V03mathfunc.ztst @@ -1,9 +1,7 @@ # Tests for the module zsh/mathfunc =20 %prep - if ( zmodload -i zsh/mathfunc ) >/dev/null 2>&1; then - zmodload -i zsh/mathfunc - else + if ! zmodload zsh/mathfunc 2>/dev/null; then ZTST_unimplemented=3D"The module zsh/mathfunc is not available." fi =20 @@ -112,7 +110,6 @@ F:This test fails if your math library doesn't have era= nd48(). float -F f sum sumsq max max2 av sd typeset -a randoms randoms=3D('f =3D RANDOM' 'f =3D rand48()') - zmodload -i zsh/mathfunc for isource in 1 2; do (( sum =3D sumsq =3D max =3D 0 )) repeat $N; do diff --git a/Test/V04features.ztst b/Test/V04features.ztst index 2790456..6939053 100644 --- a/Test/V04features.ztst +++ b/Test/V04features.ztst @@ -7,7 +7,8 @@ # We use zsh/datetime because it has a list of features that is short # but contains two types. =20 - if ! (zmodload zsh/datetime >/dev/null 2>/dev/null); then + # Subshell for prep test so we can load individual features later + if ! (zmodload zsh/datetime 2>/dev/null); then ZTST_unimplemented=3D"can't load the zsh/datetime module for testing" fi =20 diff --git a/Test/V05styles.ztst b/Test/V05styles.ztst index e932b54..ca95b63 100644 --- a/Test/V05styles.ztst +++ b/Test/V05styles.ztst @@ -2,9 +2,7 @@ =20 # Test the use of styles, if the zsh/zutil module is available. =20 - if (zmodload zsh/zutil >/dev/null 2>/dev/null); then - zmodload zsh/zutil - else + if ! zmodload zsh/zutil 2>/dev/null; then ZTST_unimplemented=3D"can't load the zsh/zutil module for testing" fi =20 diff --git a/Test/V09datetime.ztst b/Test/V09datetime.ztst index 1e677cd..63ff4ee 100644 --- a/Test/V09datetime.ztst +++ b/Test/V09datetime.ztst @@ -1,18 +1,18 @@ %prep =20 - if ! (zmodload zsh/datetime >/dev/null 2>/dev/null); then + if zmodload zsh/datetime 2>/dev/null; then + setopt multibyte + unset LC_ALL + LC_TIME=3DC + TZ=3DUTC+0 + # It's not clear this skip_extensions is correct, but the + # format in question is causing problems on Solaris. + # We'll revist this after the release. + [[ "$(strftime %^_10B 0)" =3D " JANUARY" ]] || skip_extensions=3D1 + [[ "$(LC_TIME=3Dja_JP.UTF-8 strftime %OS 1)" =3D =E4=B8=80 ]] || skip_= japanese=3D1 + else ZTST_unimplemented=3D"can't load the zsh/datetime module for testing" fi - setopt multibyte - zmodload zsh/datetime - unset LC_ALL - LC_TIME=3DC - TZ=3DUTC+0 - # It's not clear this skip_extensions is correct, but the - # format in question is causing problems on Solaris. - # We'll revist this after the release. - [[ "$(strftime %^_10B 0)" =3D " JANUARY" ]] || skip_extensions=3D1 - [[ "$(LC_TIME=3Dja_JP.UTF-8 strftime %OS 1)" =3D =E4=B8=80 ]] || skip_ja= panese=3D1 =20 %test =20 diff --git a/Test/V10private.ztst b/Test/V10private.ztst index 6c38e39..c66f175 100644 --- a/Test/V10private.ztst +++ b/Test/V10private.ztst @@ -2,10 +2,9 @@ =20 %prep =20 - if ! (zmodload zsh/param/private >/dev/null 2>/dev/null); then + if ! zmodload zsh/param/private 2>/dev/null; then ZTST_unimplemented=3D"can't load the zsh/param/private module for testi= ng" fi - zmodload zsh/param/private =20 %test =20 diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst index 14bc02e..ced7030 100644 --- a/Test/X02zlevi.ztst +++ b/Test/X02zlevi.ztst @@ -3,7 +3,7 @@ %prep if [[ $OSTYPE =3D cygwin ]]; then ZTST_unimplemented=3D"the zsh/zpty module does not work on Cygwin" - elif ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then + elif ( zmodload zsh/zpty 2>/dev/null ); then . $ZTST_srcdir/comptest comptestinit -v -z $ZTST_testdir/../Src/zsh else diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst index 383e652..1568369 100644 --- a/Test/Y01completion.ztst +++ b/Test/Y01completion.ztst @@ -3,7 +3,7 @@ %prep if [[ $OSTYPE =3D cygwin ]]; then ZTST_unimplemented=3D"the zsh/zpty module does not work on Cygwin" - elif ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then + elif ( zmodload zsh/zpty 2>/dev/null ); then . $ZTST_srcdir/comptest mkdir comp.tmp cd comp.tmp diff --git a/Test/Y02compmatch.ztst b/Test/Y02compmatch.ztst index db734fa..e2f8e1a 100644 --- a/Test/Y02compmatch.ztst +++ b/Test/Y02compmatch.ztst @@ -13,7 +13,7 @@ %prep if [[ $OSTYPE =3D cygwin ]]; then ZTST_unimplemented=3D"the zsh/zpty module does not work on Cygwin" - elif ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then + elif ( zmodload zsh/zpty 2>/dev/null ); then . $ZTST_srcdir/comptest mkdir match.tmp cd match.tmp diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst index 0627104..0147c7d 100644 --- a/Test/Y03arguments.ztst +++ b/Test/Y03arguments.ztst @@ -3,7 +3,7 @@ %prep if [[ $OSTYPE =3D cygwin ]]; then ZTST_unimplemented=3D"the zsh/zpty module does not work on Cygwin" - elif ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then + elif ( zmodload zsh/zpty 2>/dev/null ); then . $ZTST_srcdir/comptest mkdir comp.tmp cd comp.tmp diff --git a/Test/comptest b/Test/comptest index 20a3a5b..f10739a 100644 --- a/Test/comptest +++ b/Test/comptest @@ -5,7 +5,7 @@ comptestinit () { $ZTST_srcdir/../Completion $ZTST_srcdir/../Completion/*/*~*/CVS(/) ) =20 - zmodload -i zsh/zpty || return $? + zmodload zsh/zpty || return $? =20 comptest_zsh=3D${ZSH:-zsh} comptest_keymap=3De diff --git a/Test/ztst.zsh b/Test/ztst.zsh index ce89a83..cdd84b5 100755 --- a/Test/ztst.zsh +++ b/Test/ztst.zsh @@ -41,7 +41,7 @@ export MODULE_PATH =20 # We need to be able to save and restore the options used in the test. # We use the $options variable of the parameter module for this. -zmodload -i zsh/parameter +zmodload zsh/parameter =20 # Note that both the following are regular arrays, since we only use them # in whole array assignments to/from $options. --=20 Barton E. Schaefer