unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Ken Brown <kbrown@cornell.edu>, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 82a487d 03/10: Fix reading of regex-resources in regex-tests
Date: Wed, 03 Aug 2016 04:40:02 +0200	[thread overview]
Message-ID: <xa1ttwf2efst.fsf@mina86.com> (raw)
In-Reply-To: <xa1twpjyefy8.fsf@mina86.com>

On Wed, Aug 03 2016, Michal Nazarewicz wrote:
> On Tue, Aug 02 2016, Ken Brown wrote:
>> On 8/2/2016 12:05 PM, Michal Nazarewicz wrote:
>>> branch: master
>>> commit 82a487d522106c1c5afb00f2fa6c9055e37ba5ad
>>> Author: Michal Nazarewicz <mina86@mina86.com>
>>> Commit: Michal Nazarewicz <mina86@mina86.com>
>>>
>>>     Fix reading of regex-resources in regex-tests
>>>
>>>     * test/src/regex-tests.el (regex-tests-generic-line): Referring to
>>>     ‘buffer-file-name’ does not work when running the test from command
>>>     line, i.e. via make, which results in (wrong-type-argument stringp nil)
>>>     failures.  Replace it with hard-coded path.
>>
>> Four of the tests now fail for an out-of-tree build:
>>
>>     FAILED  regex-tests-BOOST
>>     FAILED  regex-tests-PCRE
>>     FAILED  regex-tests-PTESTS
>>     FAILED  regex-tests-TESTS
>>
>> Ken
>
> Does this fix this:

By which I of course meant:

diff --git a/test/src/regex-tests.el b/test/src/regex-tests.el
index 898548d..85addca 100644
--- a/test/src/regex-tests.el
+++ b/test/src/regex-tests.el
@@ -21,6 +21,11 @@
 
 (require 'ert)
 
+(defvar regex-tests--resources-dir
+  (concat (concat (file-name-directory (or load-file-name buffer-file-name))
+                  "/regex-resources/"))
+  "Path to regex-resources directory next to the \"regex-tests.el\" file.")
+
 (ert-deftest regex-word-cc-fallback-test ()
   "Test that ‘[[:cc:]]*x’ matches ‘x’ (bug#24020).
 
@@ -98,7 +103,7 @@ regex-tests-generic-line
 
   `(with-temp-buffer
     (modify-syntax-entry ?_ "w;; ") ; tests expect _ to be a word
-    (insert-file-contents ,(concat "src/regex-resources/" test-file))
+    (insert-file-contents (concat regex-tests--resources-dir ,test-file))
     (let ((case-fold-search nil)
           (line-number 1)
           (whitelist-idx 0))

-- 
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»



  reply	other threads:[~2016-08-03  2:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160802160532.8569.48288@vcs.savannah.gnu.org>
     [not found] ` <20160802160534.8844E2201A4@vcs.savannah.gnu.org>
2016-08-03  0:32   ` [Emacs-diffs] master 82a487d 03/10: Fix reading of regex-resources in regex-tests Ken Brown
2016-08-03  2:36     ` Michal Nazarewicz
2016-08-03  2:40       ` Michal Nazarewicz [this message]
2016-08-03 16:25         ` Ken Brown

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=xa1ttwf2efst.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=emacs-devel@gnu.org \
    --cc=kbrown@cornell.edu \
    /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).