aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorGlenn Morris2013-05-10 00:31:34 -0700
committerGlenn Morris2013-05-10 00:31:34 -0700
commita3f276d8ffee80c17919aea509400767d800d4bb (patch)
tree80f68cbb808b27037718e58da15f637fdb090ee1 /admin
parentf71c50d026c228b41892135377aee84442ef755d (diff)
downloademacs-a3f276d8ffee80c17919aea509400767d800d4bb.tar.gz
emacs-a3f276d8ffee80c17919aea509400767d800d4bb.zip
Add option for cus-test.el to load all Lisp files
* admin/cus-test.el (cus-test-libs-noloads): Add some files. (cus-test-get-lisp-files): New function. (cus-test-libs): Add option to load more/all Lisp files.
Diffstat (limited to 'admin')
-rw-r--r--admin/ChangeLog6
-rw-r--r--admin/cus-test.el33
2 files changed, 35 insertions, 4 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 830854c8e63..8ae595df980 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,9 @@
12013-05-10 Glenn Morris <rgm@gnu.org>
2
3 * cus-test.el (cus-test-libs-noloads): Add some files.
4 (cus-test-get-lisp-files): New function.
5 (cus-test-libs): Add option to load more/all Lisp files.
6
12013-05-09 Glenn Morris <rgm@gnu.org> 72013-05-09 Glenn Morris <rgm@gnu.org>
2 8
3 * cus-test.el: No need to provide bbdb, bbdb-com any more. 9 * cus-test.el: No need to provide bbdb, bbdb-com any more.
diff --git a/admin/cus-test.el b/admin/cus-test.el
index bce5f5da3cf..90fb40b77c2 100644
--- a/admin/cus-test.el
+++ b/admin/cus-test.el
@@ -100,7 +100,8 @@
100 "List of variables to disregard by `cus-test-apropos'.") 100 "List of variables to disregard by `cus-test-apropos'.")
101 101
102;; Loading dunnet in batch mode leads to a Dead end. 102;; Loading dunnet in batch mode leads to a Dead end.
103(defvar cus-test-libs-noloads '("play/dunnet.el") 103(defvar cus-test-libs-noloads '("play/dunnet.el" "emulation/edt-mapper.el"
104 "loadup.el" "mail/blessmail.el")
104 "List of files not to load by `cus-test-load-libs'. 105 "List of files not to load by `cus-test-load-libs'.
105Names should be as they appear in loaddefs.el.") 106Names should be as they appear in loaddefs.el.")
106 107
@@ -302,6 +303,22 @@ Don't load libraries in `cus-test-libs-noloads'."
302 (push (buffer-substring (match-end 0) (line-end-position)) files)) 303 (push (buffer-substring (match-end 0) (line-end-position)) files))
303 files))) 304 files)))
304 305
306(defun cus-test-get-lisp-files (&optional all)
307 "Return list of all Lisp files with defcustoms.
308Optional argument ALL non-nil means list all Lisp files."
309 (let ((default-directory (expand-file-name "lisp/" source-directory))
310 (msg "Finding files..."))
311 (message "%s" msg)
312 (prog1
313 ;; Hack to remove leading "./".
314 (mapcar (lambda (e) (substring e 2))
315 (apply 'process-lines find-program
316 "-name" "*.el"
317 (unless all
318 (list "-exec" grep-program
319 "-l" "^[ \t]*(defcustom" "{}" "+"))))
320 (message "%sdone" msg))))
321
305(defun cus-test-message (list) 322(defun cus-test-message (list)
306 "Print the members of LIST line by line." 323 "Print the members of LIST line by line."
307 (dolist (m list) (message "%s" m))) 324 (dolist (m list) (message "%s" m)))
@@ -401,15 +418,21 @@ in the Emacs source directory."
401 (cus-test-message cus-test-deps-errors)) 418 (cus-test-message cus-test-deps-errors))
402 (run-hooks 'cus-test-after-load-libs-hook)) 419 (run-hooks 'cus-test-after-load-libs-hook))
403 420
404(defun cus-test-libs () 421(defun cus-test-libs (&optional more)
405 "Load the libraries with autoloads in separate processes. 422 "Load the libraries with autoloads in separate processes.
406This function is useful to detect load problems of libraries. 423This function is useful to detect load problems of libraries.
407It is suitable for batch mode. E.g., invoke 424It is suitable for batch mode. E.g., invoke
408 425
409 ./src/emacs -batch -l admin/cus-test.el -f cus-test-libs 426 ./src/emacs -batch -l admin/cus-test.el -f cus-test-libs
410 427
411in the Emacs source directory." 428in the Emacs source directory.
429
430If optional argument MORE is \"defcustom\", load all files with defcustoms.
431If it is \"all\", load all Lisp files."
412 (interactive) 432 (interactive)
433 (and noninteractive
434 command-line-args-left
435 (setq more (pop command-line-args-left)))
413 (cus-test-load-1 436 (cus-test-load-1
414 (let ((default-directory source-directory) 437 (let ((default-directory source-directory)
415 (emacs (expand-file-name "src/emacs")) 438 (emacs (expand-file-name "src/emacs"))
@@ -436,7 +459,9 @@ in the Emacs source directory."
436 (error 459 (error
437 (push (cons file alpha) cus-test-libs-errors) 460 (push (cons file alpha) cus-test-libs-errors)
438 (message "Error for %s: %s" file alpha))))) 461 (message "Error for %s: %s" file alpha)))))
439 (cus-test-get-autoload-deps)) 462 (if more
463 (cus-test-get-lisp-files (equal more "all"))
464 (cus-test-get-autoload-deps)))
440 (message "Default directory: %s" default-directory) 465 (message "Default directory: %s" default-directory)
441 (when skipped 466 (when skipped
442 (message "The following libraries were skipped:") 467 (message "The following libraries were skipped:")