emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b20d05c: Don't require bytecomp for running ert tes


From: Noam Postavsky
Subject: [Emacs-diffs] master b20d05c: Don't require bytecomp for running ert tests
Date: Sat, 22 Apr 2017 23:18:43 -0400 (EDT)

branch: master
commit b20d05c6d76ddaf7e70da1430c9aac56ef1d6b31
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Don't require bytecomp for running ert tests
    
    "Fix ert-tests when running compiled" 2016-12-06 accidentally
    introduced a dependency on `bytecomp' into `ert'.  As mentioned in
    "Avoid ert test failures" 2017-04-18, the accidental dependency of ert
    on bytecomp was masked by loading other libraries until recently.
    
    * lisp/emacs-lisp/ert.el (ert--expand-should-1): Only use
    `byte-compile-macro-environment' if it's bound.
    * test/src/eval-tests.el: Add defvar for dynamic variable
    `byte-compile-debug'.
---
 lisp/emacs-lisp/ert.el | 4 ++--
 test/src/eval-tests.el | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index f4c61e6..280b76a 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -275,9 +275,9 @@ DATA is displayed to the user and should state the reason 
for skipping."
 
 (defun ert--expand-should-1 (whole form inner-expander)
   "Helper function for the `should' macro and its variants."
-  (require 'bytecomp)                   ; FIXME?
   (let ((form
-         (macroexpand form (append byte-compile-macro-environment
+         (macroexpand form (append (bound-and-true-p
+                                    byte-compile-macro-environment)
                                    (cond
                                     ((boundp 'macroexpand-all-environment)
                                      macroexpand-all-environment)
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el
index 95655ea..03f4087 100644
--- a/test/src/eval-tests.el
+++ b/test/src/eval-tests.el
@@ -32,6 +32,8 @@
   ;; This should not crash.
   (should-error (funcall '(closure)) :type 'invalid-function))
 
+(defvar byte-compile-debug)
+
 (ert-deftest eval-tests--bugs-24912-and-24913 ()
   "Checks that Emacs doesn’t accept weird argument lists.
 Bug#24912 and Bug#24913."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]