From cb10eed97cfe5c1bee2bee7b7c09b0dcbdf92e18 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 18 Dec 2021 15:14:23 +0100 Subject: Silence byte-compiler in multisession-tests.el * test/lisp/emacs-lisp/multisession-tests.el (multi-test-sqlite-simple, multi-test-sqlite-busy) (multi-test-files-simple, multi-test-files-busy) (multi-test-files-some-values): Silence byte-compiler. --- test/lisp/emacs-lisp/multisession-tests.el | 104 ++++++++++++++--------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/test/lisp/emacs-lisp/multisession-tests.el b/test/lisp/emacs-lisp/multisession-tests.el index 41fcde04f21..1bf0a533a70 100644 --- a/test/lisp/emacs-lisp/multisession-tests.el +++ b/test/lisp/emacs-lisp/multisession-tests.el @@ -35,12 +35,12 @@ (multisession-directory dir)) (unwind-protect (progn - (define-multisession-variable foo 0 + (define-multisession-variable multisession--foo 0 "" :synchronized t) - (should (= (multisession-value foo) 0)) - (cl-incf (multisession-value foo)) - (should (= (multisession-value foo) 1)) + (should (= (multisession-value multisession--foo) 0)) + (cl-incf (multisession-value multisession--foo)) + (should (= (multisession-value multisession--foo) 1)) (call-process (concat invocation-directory invocation-name) nil t nil @@ -51,11 +51,11 @@ (let ((multisession-directory ,dir) (multisession-storage 'sqlite) (user-init-file "/tmp/foo.el")) - (define-multisession-variable foo 0 + (define-multisession-variable multisession--foo 0 "" :synchronized t) - (cl-incf (multisession-value foo)))))) - (should (= (multisession-value foo) 2))) + (cl-incf (multisession-value multisession--foo)))))) + (should (= (multisession-value multisession--foo) 2))) (sqlite-close multisession--db) (setq multisession--db nil))))) @@ -69,12 +69,12 @@ proc) (unwind-protect (progn - (define-multisession-variable bar 0 + (define-multisession-variable multisession--bar 0 "" :synchronized t) - (should (= (multisession-value bar) 0)) - (cl-incf (multisession-value bar)) - (should (= (multisession-value bar) 1)) + (should (= (multisession-value multisession--bar) 0)) + (cl-incf (multisession-value multisession--bar)) + (should (= (multisession-value multisession--bar) 1)) (setq proc (start-process "other-emacs" @@ -87,18 +87,18 @@ (let ((multisession-directory ,dir) (multisession-storage 'sqlite) (user-init-file "/tmp/bar.el")) - (define-multisession-variable bar 0 + (define-multisession-variable multisession--bar 0 "" :synchronized t) (dotimes (i 100) - (cl-incf (multisession-value bar)))))))) + (cl-incf (multisession-value multisession--bar)))))))) (while (process-live-p proc) (ignore-error 'sqlite-locked-error - (message "bar %s" (multisession-value bar)) - ;;(cl-incf (multisession-value bar)) + (message "multisession--bar %s" (multisession-value multisession--bar)) + ;;(cl-incf (multisession-value multisession--bar)) ) (sleep-for 0.1)) - (message "bar ends up as %s" (multisession-value bar)) - (should (< (multisession-value bar) 1003))) + (message "multisession--bar ends up as %s" (multisession-value multisession--bar)) + (should (< (multisession-value multisession--bar) 1003))) (sqlite-close multisession--db) (setq multisession--db nil))))) @@ -108,12 +108,12 @@ (let ((user-init-file "/tmp/sfoo.el") (multisession-storage 'files) (multisession-directory dir)) - (define-multisession-variable sfoo 0 + (define-multisession-variable multisession--sfoo 0 "" :synchronized t) - (should (= (multisession-value sfoo) 0)) - (cl-incf (multisession-value sfoo)) - (should (= (multisession-value sfoo) 1)) + (should (= (multisession-value multisession--sfoo) 0)) + (cl-incf (multisession-value multisession--sfoo)) + (should (= (multisession-value multisession--sfoo) 1)) (call-process (concat invocation-directory invocation-name) nil t nil @@ -124,11 +124,11 @@ (let ((multisession-directory ,dir) (multisession-storage 'files) (user-init-file "/tmp/sfoo.el")) - (define-multisession-variable sfoo 0 + (define-multisession-variable multisession--sfoo 0 "" :synchronized t) - (cl-incf (multisession-value sfoo)))))) - (should (= (multisession-value sfoo) 2))))) + (cl-incf (multisession-value multisession--sfoo)))))) + (should (= (multisession-value multisession--sfoo) 2))))) (ert-deftest multi-test-files-busy () (skip-unless (and t (sqlite-available-p))) @@ -138,12 +138,12 @@ (multisession-storage 'files) (multisession-directory dir) proc) - (define-multisession-variable sbar 0 + (define-multisession-variable multisession--sbar 0 "" :synchronized t) - (should (= (multisession-value sbar) 0)) - (cl-incf (multisession-value sbar)) - (should (= (multisession-value sbar) 1)) + (should (= (multisession-value multisession--sbar) 0)) + (cl-incf (multisession-value multisession--sbar)) + (should (= (multisession-value multisession--sbar) 1)) (setq proc (start-process "other-emacs" @@ -156,16 +156,16 @@ (let ((multisession-directory ,dir) (multisession-storage 'files) (user-init-file "/tmp/sbar.el")) - (define-multisession-variable sbar 0 + (define-multisession-variable multisession--sbar 0 "" :synchronized t) (dotimes (i 1000) - (cl-incf (multisession-value sbar)))))))) + (cl-incf (multisession-value multisession--sbar)))))))) (while (process-live-p proc) - (message "sbar %s" (multisession-value sbar)) - ;;(cl-incf (multisession-value sbar)) + (message "multisession--sbar %s" (multisession-value multisession--sbar)) + ;;(cl-incf (multisession-value multisession--sbar)) (sleep-for 0.1)) - (message "sbar ends up as %s" (multisession-value sbar)) - (should (< (multisession-value sbar) 2000))))) + (message "multisession--sbar ends up as %s" (multisession-value multisession--sbar)) + (should (< (multisession-value multisession--sbar) 2000))))) (ert-deftest multi-test-files-some-values () (ert-with-temp-file dir @@ -173,29 +173,29 @@ (let ((user-init-file "/tmp/sfoo.el") (multisession-storage 'files) (multisession-directory dir)) - (define-multisession-variable foo1 nil) - (should (eq (multisession-value foo1) nil)) - (setf (multisession-value foo1) nil) - (should (eq (multisession-value foo1) nil)) - (setf (multisession-value foo1) t) - (should (eq (multisession-value foo1) t)) - - (define-multisession-variable foo2 t) - (setf (multisession-value foo2) nil) - (should (eq (multisession-value foo2) nil)) - (setf (multisession-value foo2) t) - (should (eq (multisession-value foo2) t)) - - (define-multisession-variable foo3 t) - (should-error (setf (multisession-value foo3) (make-marker))) + (define-multisession-variable multisession--foo1 nil) + (should (eq (multisession-value multisession--foo1) nil)) + (setf (multisession-value multisession--foo1) nil) + (should (eq (multisession-value multisession--foo1) nil)) + (setf (multisession-value multisession--foo1) t) + (should (eq (multisession-value multisession--foo1) t)) + + (define-multisession-variable multisession--foo2 t) + (setf (multisession-value multisession--foo2) nil) + (should (eq (multisession-value multisession--foo2) nil)) + (setf (multisession-value multisession--foo2) t) + (should (eq (multisession-value multisession--foo2) t)) + + (define-multisession-variable multisession--foo3 t) + (should-error (setf (multisession-value multisession--foo3) (make-marker))) (let ((string (with-temp-buffer (set-buffer-multibyte nil) (insert 0 1 2) (buffer-string)))) (should-not (multibyte-string-p string)) - (define-multisession-variable foo4 nil) - (setf (multisession-value foo4) string) - (should (equal (multisession-value foo4) string)))))) + (define-multisession-variable multisession--foo4 nil) + (setf (multisession-value multisession--foo4) string) + (should (equal (multisession-value multisession--foo4) string)))))) ;;; multisession-tests.el ends here -- cgit v1.2.3 From 21ef1740f0fe9424f2a079440d070f725b2ca558 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 18 Dec 2021 15:53:00 +0100 Subject: * lisp/dired.el (dired-mode-map): Use defvar-keymap. --- lisp/dired.el | 292 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 145 insertions(+), 147 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index b964fd9c181..a8841214156 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1920,154 +1920,152 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." ;;; Dired mode key bindings and menus -(defvar dired-mode-map +(defvar-keymap dired-mode-map + :doc "Local keymap for Dired mode buffers." + :full t + :parent special-mode-map ;; This looks ugly when substitute-command-keys uses C-d instead d: - ;; (define-key dired-mode-map "\C-d" 'dired-flag-file-deletion) - (let ((map (make-keymap))) - (set-keymap-parent map special-mode-map) - (define-key map [mouse-2] 'dired-mouse-find-file-other-window) - (define-key map [follow-link] 'mouse-face) - ;; Commands to mark or flag certain categories of files - (define-key map "#" 'dired-flag-auto-save-files) - (define-key map "." 'dired-clean-directory) - (define-key map "~" 'dired-flag-backup-files) - ;; Upper case keys (except !) for operating on the marked files - (define-key map "A" 'dired-do-find-regexp) - (define-key map "C" 'dired-do-copy) - (define-key map "B" 'dired-do-byte-compile) - (define-key map "D" 'dired-do-delete) - (define-key map "G" 'dired-do-chgrp) - (define-key map "H" 'dired-do-hardlink) - (define-key map "L" 'dired-do-load) - (define-key map "M" 'dired-do-chmod) - (define-key map "O" 'dired-do-chown) - (define-key map "P" 'dired-do-print) - (define-key map "Q" 'dired-do-find-regexp-and-replace) - (define-key map "R" 'dired-do-rename) - (define-key map "S" 'dired-do-symlink) - (define-key map "T" 'dired-do-touch) - (define-key map "X" 'dired-do-shell-command) - (define-key map "Z" 'dired-do-compress) - (define-key map "c" 'dired-do-compress-to) - (define-key map "!" 'dired-do-shell-command) - (define-key map "&" 'dired-do-async-shell-command) - ;; Comparison commands - (define-key map "=" 'dired-diff) - ;; Tree Dired commands - (define-key map "\M-\C-?" 'dired-unmark-all-files) - (define-key map "\M-\C-d" 'dired-tree-down) - (define-key map "\M-\C-u" 'dired-tree-up) - (define-key map "\M-\C-n" 'dired-next-subdir) - (define-key map "\M-\C-p" 'dired-prev-subdir) - ;; move to marked files - (define-key map "\M-{" 'dired-prev-marked-file) - (define-key map "\M-}" 'dired-next-marked-file) - ;; Make all regexp commands share a `%' prefix: - ;; We used to get to the submap via a symbol dired-regexp-prefix, - ;; but that seems to serve little purpose, and copy-keymap - ;; does a better job without it. - (define-key map "%" nil) - (define-key map "%u" 'dired-upcase) - (define-key map "%l" 'dired-downcase) - (define-key map "%d" 'dired-flag-files-regexp) - (define-key map "%g" 'dired-mark-files-containing-regexp) - (define-key map "%m" 'dired-mark-files-regexp) - (define-key map "%r" 'dired-do-rename-regexp) - (define-key map "%C" 'dired-do-copy-regexp) - (define-key map "%H" 'dired-do-hardlink-regexp) - (define-key map "%R" 'dired-do-rename-regexp) - (define-key map "%S" 'dired-do-symlink-regexp) - (define-key map "%&" 'dired-flag-garbage-files) - ;; Commands for marking and unmarking. - (define-key map "*" nil) - (define-key map "**" 'dired-mark-executables) - (define-key map "*/" 'dired-mark-directories) - (define-key map "*@" 'dired-mark-symlinks) - (define-key map "*%" 'dired-mark-files-regexp) - (define-key map "*N" 'dired-number-of-marked-files) - (define-key map "*c" 'dired-change-marks) - (define-key map "*s" 'dired-mark-subdir-files) - (define-key map "*m" 'dired-mark) - (define-key map "*u" 'dired-unmark) - (define-key map "*?" 'dired-unmark-all-files) - (define-key map "*!" 'dired-unmark-all-marks) - (define-key map "U" 'dired-unmark-all-marks) - (define-key map "*\177" 'dired-unmark-backward) - (define-key map "*\C-n" 'dired-next-marked-file) - (define-key map "*\C-p" 'dired-prev-marked-file) - (define-key map "*t" 'dired-toggle-marks) - ;; Lower keys for commands not operating on all the marked files - (define-key map "a" 'dired-find-alternate-file) - (define-key map "d" 'dired-flag-file-deletion) - (define-key map "e" 'dired-find-file) - (define-key map "f" 'dired-find-file) - (define-key map "\C-m" 'dired-find-file) - (put 'dired-find-file :advertised-binding "\C-m") - (define-key map "g" 'revert-buffer) - (define-key map "i" 'dired-maybe-insert-subdir) - (define-key map "j" 'dired-goto-file) - (define-key map "k" 'dired-do-kill-lines) - (define-key map "l" 'dired-do-redisplay) - (define-key map "m" 'dired-mark) - (define-key map "n" 'dired-next-line) - (define-key map "o" 'dired-find-file-other-window) - (define-key map "\C-o" 'dired-display-file) - (define-key map "p" 'dired-previous-line) - (define-key map "s" 'dired-sort-toggle-or-edit) - (define-key map "t" 'dired-toggle-marks) - (define-key map "u" 'dired-unmark) - (define-key map "v" 'dired-view-file) - (define-key map "w" 'dired-copy-filename-as-kill) - (define-key map "W" 'browse-url-of-dired-file) - (define-key map "x" 'dired-do-flagged-delete) - (define-key map "y" 'dired-show-file-type) - (define-key map "+" 'dired-create-directory) - ;; moving - (define-key map "<" 'dired-prev-dirline) - (define-key map ">" 'dired-next-dirline) - (define-key map "^" 'dired-up-directory) - (define-key map " " 'dired-next-line) - (define-key map [?\S-\ ] 'dired-previous-line) - (define-key map [remap next-line] 'dired-next-line) - (define-key map [remap previous-line] 'dired-previous-line) - ;; hiding - (define-key map "$" 'dired-hide-subdir) - (define-key map "\M-$" 'dired-hide-all) - (define-key map "(" 'dired-hide-details-mode) - ;; isearch - (define-key map (kbd "M-s a C-s") 'dired-do-isearch) - (define-key map (kbd "M-s a M-C-s") 'dired-do-isearch-regexp) - (define-key map (kbd "M-s f C-s") 'dired-isearch-filenames) - (define-key map (kbd "M-s f M-C-s") 'dired-isearch-filenames-regexp) - ;; misc - (define-key map [remap read-only-mode] 'dired-toggle-read-only) - ;; `toggle-read-only' is an obsolete alias for `read-only-mode' - (define-key map [remap toggle-read-only] 'dired-toggle-read-only) - (define-key map "?" 'dired-summary) - (define-key map "\177" 'dired-unmark-backward) - (define-key map [remap undo] 'dired-undo) - (define-key map [remap advertised-undo] 'dired-undo) - (define-key map [remap vc-next-action] 'dired-vc-next-action) - ;; thumbnail manipulation (image-dired) - (define-key map "\C-td" 'image-dired-display-thumbs) - (define-key map "\C-tt" 'image-dired-tag-files) - (define-key map "\C-tr" 'image-dired-delete-tag) - (define-key map "\C-tj" 'image-dired-jump-thumbnail-buffer) - (define-key map "\C-ti" 'image-dired-dired-display-image) - (define-key map "\C-tx" 'image-dired-dired-display-external) - (define-key map "\C-ta" 'image-dired-display-thumbs-append) - (define-key map "\C-t." 'image-dired-display-thumb) - (define-key map "\C-tc" 'image-dired-dired-comment-files) - (define-key map "\C-tf" 'image-dired-mark-tagged-files) - (define-key map "\C-t\C-t" 'image-dired-dired-toggle-marked-thumbs) - (define-key map "\C-te" 'image-dired-dired-edit-comment-and-tags) - ;; encryption and decryption (epa-dired) - (define-key map ":d" 'epa-dired-do-decrypt) - (define-key map ":v" 'epa-dired-do-verify) - (define-key map ":s" 'epa-dired-do-sign) - (define-key map ":e" 'epa-dired-do-encrypt) - map) - "Local keymap for Dired mode buffers.") + ;; "C-d" #'dired-flag-file-deletion + "" #'dired-mouse-find-file-other-window + "" 'mouse-face + ;; Commands to mark or flag certain categories of files + "#" #'dired-flag-auto-save-files + "." #'dired-clean-directory + "~" #'dired-flag-backup-files + ;; Upper case keys (except !) for operating on the marked files + "A" #'dired-do-find-regexp + "C" #'dired-do-copy + "B" #'dired-do-byte-compile + "D" #'dired-do-delete + "G" #'dired-do-chgrp + "H" #'dired-do-hardlink + "L" #'dired-do-load + "M" #'dired-do-chmod + "O" #'dired-do-chown + "P" #'dired-do-print + "Q" #'dired-do-find-regexp-and-replace + "R" #'dired-do-rename + "S" #'dired-do-symlink + "T" #'dired-do-touch + "X" #'dired-do-shell-command + "Z" #'dired-do-compress + "c" #'dired-do-compress-to + "!" #'dired-do-shell-command + "&" #'dired-do-async-shell-command + ;; Comparison commands + "=" #'dired-diff + ;; Tree Dired commands + "M-DEL" #'dired-unmark-all-files + "C-M-d" #'dired-tree-down + "C-M-u" #'dired-tree-up + "C-M-n" #'dired-next-subdir + "C-M-p" #'dired-prev-subdir + ;; move to marked files + "M-{" #'dired-prev-marked-file + "M-}" #'dired-next-marked-file + ;; Make all regexp commands share a `%' prefix: + ;; We used to get to the submap via a symbol dired-regexp-prefix, + ;; but that seems to serve little purpose, and copy-keymap + ;; does a better job without it. + "% u" #'dired-upcase + "% l" #'dired-downcase + "% d" #'dired-flag-files-regexp + "% g" #'dired-mark-files-containing-regexp + "% m" #'dired-mark-files-regexp + "% r" #'dired-do-rename-regexp + "% C" #'dired-do-copy-regexp + "% H" #'dired-do-hardlink-regexp + "% R" #'dired-do-rename-regexp + "% S" #'dired-do-symlink-regexp + "% &" #'dired-flag-garbage-files + ;; Commands for marking and unmarking. + "* *" #'dired-mark-executables + "* /" #'dired-mark-directories + "* @" #'dired-mark-symlinks + "* %" #'dired-mark-files-regexp + "* N" #'dired-number-of-marked-files + "* c" #'dired-change-marks + "* s" #'dired-mark-subdir-files + "* m" #'dired-mark + "* u" #'dired-unmark + "* ?" #'dired-unmark-all-files + "* !" #'dired-unmark-all-marks + "U" #'dired-unmark-all-marks + "* DEL" #'dired-unmark-backward + "* C-n" #'dired-next-marked-file + "* C-p" #'dired-prev-marked-file + "* t" #'dired-toggle-marks + ;; Lower keys for commands not operating on all the marked files + "a" #'dired-find-alternate-file + "d" #'dired-flag-file-deletion + "e" #'dired-find-file + "f" #'dired-find-file + "C-m" #'dired-find-file + "g" #'revert-buffer + "i" #'dired-maybe-insert-subdir + "j" #'dired-goto-file + "k" #'dired-do-kill-lines + "l" #'dired-do-redisplay + "m" #'dired-mark + "n" #'dired-next-line + "o" #'dired-find-file-other-window + "C-o" #'dired-display-file + "p" #'dired-previous-line + "s" #'dired-sort-toggle-or-edit + "t" #'dired-toggle-marks + "u" #'dired-unmark + "v" #'dired-view-file + "w" #'dired-copy-filename-as-kill + "W" #'browse-url-of-dired-file + "x" #'dired-do-flagged-delete + "y" #'dired-show-file-type + "+" #'dired-create-directory + ;; moving + "<" #'dired-prev-dirline + ">" #'dired-next-dirline + "^" #'dired-up-directory + "SPC" #'dired-next-line + "S-SPC" #'dired-previous-line + " " #'dired-next-line + " " #'dired-previous-line + ;; hiding + "$" #'dired-hide-subdir + "M-$" #'dired-hide-all + "(" #'dired-hide-details-mode + ;; isearch + "M-s a C-s" #'dired-do-isearch + "M-s a C-M-s" #'dired-do-isearch-regexp + "M-s f C-s" #'dired-isearch-filenames + "M-s f C-M-s" #'dired-isearch-filenames-regexp + ;; misc + " " #'dired-toggle-read-only + ;; `toggle-read-only' is an obsolete alias for `read-only-mode' + " " #'dired-toggle-read-only + "?" #'dired-summary + "DEL" #'dired-unmark-backward + " " #'dired-undo + " " #'dired-undo + " " #'dired-vc-next-action + ;; thumbnail manipulation (image-dired) + "C-t d" #'image-dired-display-thumbs + "C-t t" #'image-dired-tag-files + "C-t r" #'image-dired-delete-tag + "C-t j" #'image-dired-jump-thumbnail-buffer + "C-t i" #'image-dired-dired-display-image + "C-t x" #'image-dired-dired-display-external + "C-t a" #'image-dired-display-thumbs-append + "C-t ." #'image-dired-display-thumb + "C-t c" #'image-dired-dired-comment-files + "C-t f" #'image-dired-mark-tagged-files + "C-t C-t" #'image-dired-dired-toggle-marked-thumbs + "C-t e" #'image-dired-dired-edit-comment-and-tags + ;; encryption and decryption (epa-dired) + ": d" #'epa-dired-do-decrypt + ": v" #'epa-dired-do-verify + ": s" #'epa-dired-do-sign + ": e" #'epa-dired-do-encrypt) + +(put 'dired-find-file :advertised-binding (kbd "RET")) (easy-menu-define dired-mode-subdir-menu dired-mode-map "Subdir menu for Dired mode." -- cgit v1.2.3 From 55f652c856837b903b28917c8f5c6834b1483197 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 18 Dec 2021 18:43:18 +0100 Subject: Make generation of JUnit test reports more robust. * lisp/emacs-lisp/ert.el (ert-load-file-name): New defvar. (ert-write-junit-test-report): Use it. Make detection of selector more robust. Protect calls of `xml-escape-string' with 'noerror. * test/infra/Makefile.in (subdir_template): Use "make -k ...". * test/infra/gitlab-ci.yml (test-filenotify-gio): Adapt make_params in order to get a JUnit test report. (test-native-comp-speed0): Use "make -k ...". * test/infra/test-jobs.yml: Regenerate. * test/lisp/progmodes/perl-mode-tests.el (top): Set `ert-load-file-name'. --- lisp/emacs-lisp/ert.el | 41 +++++++++++++++------- test/infra/Makefile.in | 2 +- test/infra/gitlab-ci.yml | 5 +-- test/infra/test-jobs.yml | 64 +++++++++++++++++----------------- test/lisp/progmodes/perl-mode-tests.el | 2 ++ 5 files changed, 66 insertions(+), 48 deletions(-) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 019916e6172..cc464a0f819 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1527,13 +1527,20 @@ the tests)." (backtrace)) (kill-emacs 2)))) +(defvar ert-load-file-name nil + "The name of the loaded ERT test file, a string. +Usually, it is not needed to be defined, but if different ERT +test packages depend on each other, it might be helpful.") + (defun ert-write-junit-test-report (stats) "Write a JUnit test report, generated from STATS." ;; https://www.ibm.com/docs/en/developer-for-zos/14.1.0?topic=formats-junit-xml-format ;; https://llg.cubic.org/docs/junit/ (when-let ((symbol (car (apropos-internal "" #'ert-test-boundp))) (test-file (symbol-file symbol 'ert--test)) - (test-report (file-name-with-extension test-file "xml"))) + (test-report + (file-name-with-extension + (or ert-load-file-name test-file) "xml"))) (with-temp-file test-report (insert "\n") (insert (format "\n" @@ -1557,15 +1564,19 @@ the tests)." (ert--stats-end-time stats) (ert--stats-start-time stats))) (ert--format-time-iso8601 (ert--stats-end-time stats)))) - (insert " \n" - (format " \n" - (ert--stats-selector stats)) - " \n") + ;; If the test has aborted, `ert--stats-selector' might return + ;; huge junk. Skip this. + (when (< (length (format "%s" (ert--stats-selector stats))) 1024) + (insert " \n" + (format " \n" + (xml-escape-string + (format "%s" (ert--stats-selector stats)) 'noerror)) + " \n")) (cl-loop for test across (ert--stats-tests stats) for result = (ert-test-most-recent-result test) do (insert (format " \n" (xml-escape-string (string-trim - (ert-reason-for-test-result result))) + (ert-reason-for-test-result result)) + 'noerror) (ert-string-for-test-result result (ert-test-result-expected-p test result))) (xml-escape-string (string-trim - (ert-reason-for-test-result result))) + (ert-reason-for-test-result result)) + 'noerror) "\n" " \n")) ((ert-test-aborted-with-non-local-exit-p result) @@ -1600,27 +1613,29 @@ the tests)." test result))) (format "Test %s aborted with non-local exit\n" (xml-escape-string - (symbol-name (ert-test-name test)))) + (symbol-name (ert-test-name test)) 'noerror)) " \n")) ((not (ert-test-result-type-p result (ert-test-expected-result-type test))) (insert (format " \n" (xml-escape-string (string-trim - (ert-reason-for-test-result result))) + (ert-reason-for-test-result result)) + 'noerror) (ert-string-for-test-result result (ert-test-result-expected-p test result))) (xml-escape-string (string-trim - (ert-reason-for-test-result result))) + (ert-reason-for-test-result result)) + 'noerror) "\n" " \n"))) (unless (zerop (length (ert-test-result-messages result))) (insert " \n" (xml-escape-string - (ert-test-result-messages result)) + (ert-test-result-messages result) 'noerror) " \n")) (insert " \n"))) (insert " \n") @@ -1653,7 +1668,7 @@ the tests)." (insert (format " \n" (file-name-nondirectory test-report))) (when logfile-contents - (insert (xml-escape-string logfile-contents))) + (insert (xml-escape-string logfile-contents 'noerror))) (insert " \n" " \n" " \n") diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index e4f99743e09..368be7392b2 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -84,7 +84,7 @@ define subdir_template @echo ' - test/$(1)/*resources/**' >>$(FILE) @echo ' variables:' >>$(FILE) @echo ' target: emacs-inotify' >>$(FILE) - @echo ' make_params: "-C test $(target)"' >>$(FILE) + @echo ' make_params: "-k -C test $(target)"' >>$(FILE) endef $(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir)))) diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 3903642c792..dd3f517e74a 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -226,7 +226,8 @@ test-filenotify-gio: optional: true variables: target: emacs-filenotify-gio - make_params: "-k -C test autorevert-tests.log filenotify-tests.log" + # This is needed in order to get a JUnit test report. + make_params: '-k -C test check-expensive LOGFILES="lisp/autorevert-tests.log lisp/filenotify-tests.log"' build-image-gnustep: stage: platform-images @@ -271,7 +272,7 @@ test-native-comp-speed0: optional: true variables: target: emacs-native-comp-speed0 - make_params: "-C test check SELECTOR='(not (tag :unstable))'" + make_params: "-k -C test check SELECTOR='(not (tag :unstable))'" # Local Variables: # add-log-current-defun-header-regexp: "^\\([-_.[:alnum:]]+\\)[ \t]*:" diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index 63b052bf8c7..51707c181b1 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -15,7 +15,7 @@ test-lib-src-inotify: - test/lib-src/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lib-src" + make_params: "-k -C test check-lib-src" test-lisp-inotify: stage: normal @@ -32,7 +32,7 @@ test-lisp-inotify: - test/lisp/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp" + make_params: "-k -C test check-lisp" test-lisp-calc-inotify: stage: normal @@ -49,7 +49,7 @@ test-lisp-calc-inotify: - test/lisp/calc/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-calc" + make_params: "-k -C test check-lisp-calc" test-lisp-calendar-inotify: stage: normal @@ -66,7 +66,7 @@ test-lisp-calendar-inotify: - test/lisp/calendar/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-calendar" + make_params: "-k -C test check-lisp-calendar" test-lisp-cedet-inotify: stage: normal @@ -83,7 +83,7 @@ test-lisp-cedet-inotify: - test/lisp/cedet/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-cedet" + make_params: "-k -C test check-lisp-cedet" test-lisp-cedet-semantic-inotify: stage: normal @@ -100,7 +100,7 @@ test-lisp-cedet-semantic-inotify: - test/lisp/cedet/semantic/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-cedet-semantic" + make_params: "-k -C test check-lisp-cedet-semantic" test-lisp-cedet-semantic-bovine-inotify: stage: normal @@ -117,7 +117,7 @@ test-lisp-cedet-semantic-bovine-inotify: - test/lisp/cedet/semantic/bovine/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-cedet-semantic-bovine" + make_params: "-k -C test check-lisp-cedet-semantic-bovine" test-lisp-cedet-srecode-inotify: stage: normal @@ -134,7 +134,7 @@ test-lisp-cedet-srecode-inotify: - test/lisp/cedet/srecode/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-cedet-srecode" + make_params: "-k -C test check-lisp-cedet-srecode" test-lisp-emacs-lisp-inotify: stage: normal @@ -151,7 +151,7 @@ test-lisp-emacs-lisp-inotify: - test/lisp/emacs-lisp/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-emacs-lisp" + make_params: "-k -C test check-lisp-emacs-lisp" test-lisp-emacs-lisp-eieio-tests-inotify: stage: normal @@ -168,7 +168,7 @@ test-lisp-emacs-lisp-eieio-tests-inotify: - test/lisp/emacs-lisp/eieio-tests/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-emacs-lisp-eieio-tests" + make_params: "-k -C test check-lisp-emacs-lisp-eieio-tests" test-lisp-emacs-lisp-faceup-tests-inotify: stage: normal @@ -185,7 +185,7 @@ test-lisp-emacs-lisp-faceup-tests-inotify: - test/lisp/emacs-lisp/faceup-tests/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-emacs-lisp-faceup-tests" + make_params: "-k -C test check-lisp-emacs-lisp-faceup-tests" test-lisp-emulation-inotify: stage: normal @@ -202,7 +202,7 @@ test-lisp-emulation-inotify: - test/lisp/emulation/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-emulation" + make_params: "-k -C test check-lisp-emulation" test-lisp-erc-inotify: stage: normal @@ -219,7 +219,7 @@ test-lisp-erc-inotify: - test/lisp/erc/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-erc" + make_params: "-k -C test check-lisp-erc" test-lisp-eshell-inotify: stage: normal @@ -236,7 +236,7 @@ test-lisp-eshell-inotify: - test/lisp/eshell/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-eshell" + make_params: "-k -C test check-lisp-eshell" test-lisp-gnus-inotify: stage: normal @@ -253,7 +253,7 @@ test-lisp-gnus-inotify: - test/lisp/gnus/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-gnus" + make_params: "-k -C test check-lisp-gnus" test-lisp-image-inotify: stage: normal @@ -270,7 +270,7 @@ test-lisp-image-inotify: - test/lisp/image/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-image" + make_params: "-k -C test check-lisp-image" test-lisp-international-inotify: stage: normal @@ -287,7 +287,7 @@ test-lisp-international-inotify: - test/lisp/international/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-international" + make_params: "-k -C test check-lisp-international" test-lisp-mail-inotify: stage: normal @@ -304,7 +304,7 @@ test-lisp-mail-inotify: - test/lisp/mail/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-mail" + make_params: "-k -C test check-lisp-mail" test-lisp-mh-e-inotify: stage: normal @@ -321,7 +321,7 @@ test-lisp-mh-e-inotify: - test/lisp/mh-e/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-mh-e" + make_params: "-k -C test check-lisp-mh-e" test-lisp-net-inotify: stage: normal @@ -338,7 +338,7 @@ test-lisp-net-inotify: - test/lisp/net/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-net" + make_params: "-k -C test check-lisp-net" test-lisp-nxml-inotify: stage: normal @@ -355,7 +355,7 @@ test-lisp-nxml-inotify: - test/lisp/nxml/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-nxml" + make_params: "-k -C test check-lisp-nxml" test-lisp-obsolete-inotify: stage: normal @@ -372,7 +372,7 @@ test-lisp-obsolete-inotify: - test/lisp/obsolete/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-obsolete" + make_params: "-k -C test check-lisp-obsolete" test-lisp-org-inotify: stage: normal @@ -389,7 +389,7 @@ test-lisp-org-inotify: - test/lisp/org/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-org" + make_params: "-k -C test check-lisp-org" test-lisp-play-inotify: stage: normal @@ -406,7 +406,7 @@ test-lisp-play-inotify: - test/lisp/play/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-play" + make_params: "-k -C test check-lisp-play" test-lisp-progmodes-inotify: stage: normal @@ -423,7 +423,7 @@ test-lisp-progmodes-inotify: - test/lisp/progmodes/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-progmodes" + make_params: "-k -C test check-lisp-progmodes" test-lisp-so-long-tests-inotify: stage: normal @@ -440,7 +440,7 @@ test-lisp-so-long-tests-inotify: - test/lisp/so-long-tests/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-so-long-tests" + make_params: "-k -C test check-lisp-so-long-tests" test-lisp-term-inotify: stage: normal @@ -457,7 +457,7 @@ test-lisp-term-inotify: - test/lisp/term/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-term" + make_params: "-k -C test check-lisp-term" test-lisp-textmodes-inotify: stage: normal @@ -474,7 +474,7 @@ test-lisp-textmodes-inotify: - test/lisp/textmodes/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-textmodes" + make_params: "-k -C test check-lisp-textmodes" test-lisp-url-inotify: stage: normal @@ -491,7 +491,7 @@ test-lisp-url-inotify: - test/lisp/url/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-url" + make_params: "-k -C test check-lisp-url" test-lisp-vc-inotify: stage: normal @@ -508,7 +508,7 @@ test-lisp-vc-inotify: - test/lisp/vc/*resources/** variables: target: emacs-inotify - make_params: "-C test check-lisp-vc" + make_params: "-k -C test check-lisp-vc" test-misc-inotify: stage: normal @@ -525,7 +525,7 @@ test-misc-inotify: - test/misc/*resources/** variables: target: emacs-inotify - make_params: "-C test check-misc" + make_params: "-k -C test check-misc" test-src-inotify: stage: normal @@ -542,4 +542,4 @@ test-src-inotify: - test/src/*resources/** variables: target: emacs-inotify - make_params: "-C test check-src" + make_params: "-k -C test check-src" diff --git a/test/lisp/progmodes/perl-mode-tests.el b/test/lisp/progmodes/perl-mode-tests.el index 3f4af5e1f61..b059f539159 100644 --- a/test/lisp/progmodes/perl-mode-tests.el +++ b/test/lisp/progmodes/perl-mode-tests.el @@ -37,4 +37,6 @@ (file-name-directory (or load-file-name buffer-file-name))))) +(setq ert-load-file-name load-file-name) + ;;; perl-mode-tests.el ends here -- cgit v1.2.3 From 941d15558f013612689afe9fd2501ce6119a5120 Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Sat, 18 Dec 2021 19:45:38 +0100 Subject: Remove incorrect byte-hunk-handler for `eval` This optimisation is of very limited utility and miscompiles top-level code having the form (eval 'CODE t) by replacing it with CODE which will then, as things currently stand, be evaluated with dynamic binding. * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-eval): Remove. --- lisp/emacs-lisp/bytecomp.el | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 644d9f1a470..a98c9197a06 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2677,15 +2677,6 @@ list that represents a doc string reference. (prog1 (byte-compile-keep-pending form) (apply 'make-obsolete (mapcar 'eval (cdr form))))) -;; This handler is not necessary, but it makes the output from dont-compile -;; and similar macros cleaner. -(put 'eval 'byte-hunk-handler 'byte-compile-file-form-eval) -(defun byte-compile-file-form-eval (form) - (if (and (eq (car-safe (nth 1 form)) 'quote) - (equal (nth 2 form) lexical-binding)) - (nth 1 (nth 1 form)) - (byte-compile-keep-pending form))) - (defun byte-compile-file-form-defmumble (name macro arglist body rest) "Process a `defalias' for NAME. If MACRO is non-nil, the definition is known to be a macro. -- cgit v1.2.3