zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Jun T <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] find RLIM_NLIMITS correctly on CygwinjL
Date: Wed, 25 Mar 2020 23:42:44 +0000	[thread overview]
Message-ID: <20200325234244.63b0ba92@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <20200325220455.18501146@tarpaulin.shahaf.local2>

Daniel Shahaf wrote on Wed, 25 Mar 2020 22:04 +0000:
> Jun T wrote on Wed, 25 Mar 2020 09:16 +0900:
> > > 2020/03/24 11:43, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > > 2020/03/21 2:02, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > >     
> > >> + limit | grep UNKNOWN || print OK    
> > > 
> > > The "limit" builtin is provided by a module.  As such, it can be
> > > unavailable if the module had been disabled in config.modules prior to
> > > building.    
> > 
> > So what the fix for this? Is it enough to skip the tests if loading
> > rlimits module fails (because we are testing module features, not
> > module loading)?  
> 
> Yes, I think so.  The patch in 45591 will take care of testing that
> zmodload succeeds.  With that patch, B12limit.ztst can just do
> «if ! zmodload …; ZTST_unimplemented=…» like all other V*ztst files:
> zmodload errors will be caught by 45591.

So, to be concrete, how about the following? —

workers/45591 (with conflicts fixed):

[[[
diff --git a/Test/V01zmodload.ztst b/Test/V01zmodload.ztst
index 0a7fbb651..daf49cd72 100644
--- a/Test/V01zmodload.ztst
+++ b/Test/V01zmodload.ztst
@@ -64,7 +64,7 @@
 
  for m in $mods
  do
-   zmodload $m || mods[(r)$m]=()
+   zmodload $m || return $?
  done
 0d:Test loading of all compiled modules
 
diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst
index ab67f3d80..15a0982c8 100644
--- a/Test/V07pcre.ztst
+++ b/Test/V07pcre.ztst
@@ -1,11 +1,10 @@
 %prep
 
-  if grep '^name=zsh/pcre .* link=no ' $ZTST_testdir/../config.modules >/dev/null
+  if ! zmodload zsh/pcre 2>/dev/null; then
   then
     ZTST_unimplemented="the zsh/pcre module was disabled by configure (see config.modules)"
     return 0
   fi
-  zmodload zsh/pcre
   setopt rematch_pcre
 # Find a UTF-8 locale.
   setopt multibyte
]]]

Followed by 45584, adjusted for the above:

[[[
diff --git a/Test/B12limit.ztst b/Test/B12limit.ztst
index 922751369..48d33e6e3 100644
--- a/Test/B12limit.ztst
+++ b/Test/B12limit.ztst
@@ -1,4 +1,12 @@
-# check if there is unknown resouce(s)
+
+%prep
+
+  if ! zmodload zsh/rlimits 2>/dev/null
+  then
+    ZTST_unimplemented="the zsh/rlimits module was disabled by configure (see config.modules)"
+    return 0
+  fi
+  zmodload zsh/rlimits
 
 %test
]]]

Cheers,

Daniel

  reply	other threads:[~2020-03-25 23:43 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 10:39 [PATCH] find RLIM_NLIMITS correctly on Cygwin Jun T
2020-01-08 21:33 ` Daniel Shahaf
2020-01-09 10:32   ` Jun T
2020-01-09 13:15     ` Daniel Shahaf
2020-01-10 10:24       ` Jun T
2020-01-11 20:15         ` Daniel Shahaf
2020-01-13 11:00           ` Jun T
2020-01-13 16:42             ` Daniel Shahaf
2020-01-14  4:44               ` Jun T
2020-01-14 16:25                 ` Daniel Shahaf
2020-02-25  9:38                   ` Jun T
2020-02-27 13:22                     ` Daniel Shahaf
2020-02-27 18:46                       ` Mikael Magnusson
2020-02-28  8:42                       ` Jun T
2020-02-28 14:19                         ` Daniel Shahaf
2020-02-28 14:31                           ` Daniel Shahaf
2020-03-03  9:23                           ` Jun T
2020-03-04 19:29                             ` Daniel Shahaf
2020-03-05 10:26                               ` Jun T
2020-03-05 14:58                                 ` Daniel Shahaf
2020-03-20 17:02                             ` Daniel Shahaf
2020-03-20 17:20                               ` Bart Schaefer
2020-03-20 17:39                                 ` Daniel Shahaf
2020-03-20 18:28                                   ` Daniel Shahaf
2020-03-20 18:36                                     ` Bart Schaefer
2020-03-20 19:38                                       ` Daniel Shahaf
2020-03-20 18:39                                     ` Bart Schaefer
2020-03-20 19:32                                       ` Daniel Shahaf
2020-03-20 19:18                     ` Daniel Shahaf
2020-03-23  5:31                       ` Jun T
2020-03-24  2:08                         ` Daniel Shahaf
2020-03-23  5:41                       ` Jun T
2020-03-24  1:33                         ` Jun T
2020-03-24  2:43                           ` Daniel Shahaf
2020-03-25  0:16                             ` Jun T
2020-03-25 22:04                               ` Daniel Shahaf
2020-03-25 23:42                                 ` Daniel Shahaf [this message]
2020-03-24  2:34                         ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200325234244.63b0ba92@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).