aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPhilipp Stephani2018-01-28 21:36:03 +0100
committerPhilipp Stephani2018-02-02 20:56:01 +0100
commit0443411f5ce2594a6ec092cd96b92d0b920372f5 (patch)
tree7790497b70f0719498fe17043c956b42339a83e8 /test
parent75c663f834528c5431973bf8dc6386c327f9fe0f (diff)
downloademacs-0443411f5ce2594a6ec092cd96b92d0b920372f5.tar.gz
emacs-0443411f5ce2594a6ec092cd96b92d0b920372f5.zip
Properly integrate modules into the loading process (Bug#30164).
* src/lread.c (Fload): Don't defer to module-load immediately when encountering a module, but use the normal loading machinery to properly set up load-history, check for recursive loads, print messages, etc. * test/src/emacs-module-tests.el (module/load-history): New test. (module/describe-function-1): Adapt test. * etc/NEWS: Mention fixed behavior.
Diffstat (limited to 'test')
-rw-r--r--test/src/emacs-module-tests.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 052f5c2f12c..4751638968f 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -17,6 +17,7 @@
17;; You should have received a copy of the GNU General Public License 17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ 18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
19 19
20(require 'cl-lib)
20(require 'ert) 21(require 'ert)
21(require 'help-fns) 22(require 'help-fns)
22 23
@@ -267,13 +268,21 @@ during garbage collection."
267 (with-temp-buffer 268 (with-temp-buffer
268 (let ((standard-output (current-buffer))) 269 (let ((standard-output (current-buffer)))
269 (describe-function-1 #'mod-test-sum) 270 (describe-function-1 #'mod-test-sum)
270 (should (equal (buffer-substring-no-properties 1 (point-max)) 271 (should (equal
271 ;; FIXME: This should print the actual module 272 (buffer-substring-no-properties 1 (point-max))
272 ;; filename. 273 (format "a module function in `data/emacs-module/mod-test%s'.
273 "a module function in `src/emacs-module-tests.el'.
274 274
275(mod-test-sum a b) 275(mod-test-sum a b)
276 276
277Return A + B"))))) 277Return A + B"
278 module-file-suffix))))))
279
280(ert-deftest module/load-history ()
281 "Check that Bug#30164 is fixed."
282 (load mod-test-file)
283 (cl-destructuring-bind (file &rest entries) (car load-history)
284 (should (equal (file-name-sans-extension file) mod-test-file))
285 (should (member '(provide . mod-test) entries))
286 (should (member '(defun . mod-test-sum) entries))))
278 287
279;;; emacs-module-tests.el ends here 288;;; emacs-module-tests.el ends here