Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] find RLIM_NLIMITS correctly on Cygwin



Good morning Jun-san,

I've started to review the rlimits patch and have found an issue:

Jun T wrote on Tue, 03 Mar 2020 18:23 +0900:
> diff --git a/Test/B12limit.ztst b/Test/B12limit.ztst
> new file mode 100644
> index 000000000..2a072da08
> --- /dev/null
> +++ b/Test/B12limit.ztst
> @@ -0,0 +1,10 @@
> +# check if there is unknown resouce(s)
> +
> +%test
> +
> + ZTST_not_fatal=1
> + limit | grep UNKNOWN || print OK
> +0:Check if there is unknown resouce(s) in the system
> +>OK  
> +F:A failure here just indicates there is a resource in your system that is
> +F:unknown to zsh developers. Please report this to zsh-workers mailing list.

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.

Proposed patch:

[[[
diff --git a/Test/B12limit.ztst b/Test/B12limit.ztst
index 5dd7afdbe..2a4749632 100644
--- a/Test/B12limit.ztst
+++ b/Test/B12limit.ztst
@@ -1,4 +1,12 @@
-# check if there is unknown resouce(s)
+
+%prep
+
+  if grep '^name=zsh/rlimits .* link=no ' $ZTST_testdir/../config.modules >/dev/null
+  then
+    ZTST_unimplemented="the zsh/rlimits module was disabled by configure (see config.modules)"
+    return 0
+  fi
+  zmodload zsh/rlimits
 
 %test
 
]]]

(The %prep block is copied verbatim from V07pcre.ztst.)

With that patch, B12limit.ztst gets skipped if zsh/rlimits is disabled.

Cheers,

Daniel

P.S. Shouldn't the test file should be renamed into the V namespace?



Messages sorted by: Reverse Date, Date, Thread, Author