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'.
This commit is contained in:
Noam Postavsky 2017-04-04 23:48:42 -04:00
parent 5317193fe5
commit b20d05c6d7
2 changed files with 4 additions and 2 deletions

View file

@ -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)