unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: "Daniel Martín" <mardani29@yahoo.es>, emacs-devel@gnu.org
Subject: Re: [PATCH] Fix some failing tests in BSD systems
Date: Mon, 4 Jan 2021 03:43:40 +0200	[thread overview]
Message-ID: <c45c98fb-8354-03bc-40aa-ed230219d413@yandex.ru> (raw)
In-Reply-To: <m1sg7i7xfl.fsf@yahoo.es>

Hi Daniel,

On 03.01.2021 19:16, Daniel Martín wrote:
> 
> A couple of tests are failing for me on master and a BSD system (macOS):
> 
> 2 unexpected results:
>     FAILED  xref--xref-file-name-display-is-abs
>     FAILED  xref--xref-file-name-display-is-relative-to-project-root
> 
> An extract of a test failure is
> 
> (list-elt 0 (arrays-of-different-length 25 24
> "xref-resources//file1.txt" "xref-resources/file1.txt" first-mismatch-at
> 15))
> 
> The reason for the failure is that BSD 'find' sometimes outputs paths
> with an extra '/', for example:
> 
> find /path/emacs/test/lisp/progmodes/xref-resources/ -type f \( -iname \* \)
> /path/emacs/test/lisp/progmodes/xref-resources//file2.txt
> /path/emacs/test/lisp/progmodes/xref-resources//file1.txt
> 
> (Note the trailing '/' in the first argument to 'find'.)
> 
> As I think this differs from GNU find but it's still a valid POSIX path,
> I decided to make the tests more flexible.

I don't mind the proposed change to the tests, but if this is the only 
situation when the BSD find behaves differently, we could try to avoid 
it like this:

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index d2b5acd555..019c9a35bc 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1374,7 +1374,8 @@ xref-matches-in-directory
         ;; do that reliably enough, without creating false negatives?
         (command (xref--rgrep-command (xref--regexp-to-extended regexp)
                                       files
-                                     (file-local-name (expand-file-name 
dir))
+                                     (directory-file-name
+                                      (file-local-name 
(expand-file-name dir)))
                                       ignores))
         (def default-directory)
         (buf (get-buffer-create " *xref-grep*"))



  parent reply	other threads:[~2021-01-04  1:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1sg7i7xfl.fsf.ref@yahoo.es>
2021-01-03 17:16 ` [PATCH] Fix some failing tests in BSD systems Daniel Martín
2021-01-03 17:35   ` Eli Zaretskii
2021-01-03 21:08     ` Daniel Martín
2021-01-04  1:41     ` Dmitry Gutov
2021-01-04  3:30       ` Eli Zaretskii
2021-01-04 13:10         ` Dmitry Gutov
2021-01-04 15:52           ` Eli Zaretskii
2021-01-04 17:10             ` Dmitry Gutov
2021-01-04 22:25               ` Daniel Martín
2021-01-06  1:38                 ` Dmitry Gutov
2021-01-06  9:41                   ` Daniel Martín
2021-01-06 17:17                     ` Dmitry Gutov
2021-01-06 18:48                       ` Stefan Monnier
2021-01-06 21:17                         ` Dmitry Gutov
2021-01-04  1:43   ` Dmitry Gutov [this message]
2021-01-04  3:48     ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=c45c98fb-8354-03bc-40aa-ed230219d413@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=mardani29@yahoo.es \
    /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.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).