diff options
| author | Glenn Morris | 2013-05-10 19:29:57 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-05-10 19:29:57 -0700 |
| commit | 5d108606177a27f9199a972aeb99b18ef4c0465c (patch) | |
| tree | 1c9dc2706171412a16e022d8e5a8ba468da36906 /admin | |
| parent | f20def1f2e5ba9e0b093b050315b80b517c02dfb (diff) | |
| download | emacs-5d108606177a27f9199a972aeb99b18ef4c0465c.tar.gz emacs-5d108606177a27f9199a972aeb99b18ef4c0465c.zip | |
More cus-test.el tweaks
* admin/cus-test.el (cus-test-libs-noloads): Add a few more files.
(cus-test-load-libs, cus-test-opts):
Add option to load more/all Lisp files.
(cus-test-get-lisp-files): Ignore .*.el files.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/ChangeLog | 7 | ||||
| -rw-r--r-- | admin/cus-test.el | 34 |
2 files changed, 31 insertions, 10 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index 8ae595df980..b83b0811e54 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-05-11 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * cus-test.el (cus-test-libs-noloads): Add a few more files. | ||
| 4 | (cus-test-load-libs, cus-test-opts): | ||
| 5 | Add option to load more/all Lisp files. | ||
| 6 | (cus-test-get-lisp-files): Ignore .*.el files. | ||
| 7 | |||
| 1 | 2013-05-10 Glenn Morris <rgm@gnu.org> | 8 | 2013-05-10 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * cus-test.el (cus-test-libs-noloads): Add some files. | 10 | * cus-test.el (cus-test-libs-noloads): Add some files. |
diff --git a/admin/cus-test.el b/admin/cus-test.el index 90fb40b77c2..3553f62bb0e 100644 --- a/admin/cus-test.el +++ b/admin/cus-test.el | |||
| @@ -99,9 +99,14 @@ | |||
| 99 | (defvar cus-test-skip-list nil | 99 | (defvar cus-test-skip-list nil |
| 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 | (defvar cus-test-libs-noloads |
| 103 | (defvar cus-test-libs-noloads '("play/dunnet.el" "emulation/edt-mapper.el" | 103 | ;; Loading dunnet in batch mode leads to a Dead end. |
| 104 | "loadup.el" "mail/blessmail.el") | 104 | ;; blessmail writes a file. |
| 105 | ;; characters cannot be loaded twice ("Category `a' is already defined"). | ||
| 106 | '("play/dunnet.el" "emulation/edt-mapper.el" | ||
| 107 | "loadup.el" "mail/blessmail.el" "international/characters.el" | ||
| 108 | "cedet/ede/loaddefs.el" "cedet/semantic/loaddefs.el" | ||
| 109 | "net/tramp-loaddefs.el") | ||
| 105 | "List of files not to load by `cus-test-load-libs'. | 110 | "List of files not to load by `cus-test-load-libs'. |
| 106 | Names should be as they appear in loaddefs.el.") | 111 | Names should be as they appear in loaddefs.el.") |
| 107 | 112 | ||
| @@ -277,9 +282,11 @@ The detected problematic options are stored in `cus-test-errors'." | |||
| 277 | (run-hooks 'cus-test-after-load-libs-hook))) | 282 | (run-hooks 'cus-test-after-load-libs-hook))) |
| 278 | 283 | ||
| 279 | ;; This is just cus-test-libs, but loading in the current Emacs process. | 284 | ;; This is just cus-test-libs, but loading in the current Emacs process. |
| 280 | (defun cus-test-load-libs () | 285 | (defun cus-test-load-libs (&optional more) |
| 281 | "Load the libraries with autoloads. | 286 | "Load the libraries with autoloads. |
| 282 | Don't load libraries in `cus-test-libs-noloads'." | 287 | Don't load libraries in `cus-test-libs-noloads'. |
| 288 | If optional argument MORE is \"defcustom\", load all files with defcustoms. | ||
| 289 | If it is \"all\", load all Lisp files." | ||
| 283 | (interactive) | 290 | (interactive) |
| 284 | (cus-test-load-1 | 291 | (cus-test-load-1 |
| 285 | (let ((lispdir (file-name-directory (locate-library "loaddefs")))) | 292 | (let ((lispdir (file-name-directory (locate-library "loaddefs")))) |
| @@ -292,7 +299,9 @@ Don't load libraries in `cus-test-libs-noloads'." | |||
| 292 | (error | 299 | (error |
| 293 | (push (cons file alpha) cus-test-libs-errors) | 300 | (push (cons file alpha) cus-test-libs-errors) |
| 294 | (message "Error for %s: %s" file alpha)))) | 301 | (message "Error for %s: %s" file alpha)))) |
| 295 | (cus-test-get-autoload-deps))))) | 302 | (if more |
| 303 | (cus-test-get-lisp-files (equal more "all")) | ||
| 304 | (cus-test-get-autoload-deps)))))) | ||
| 296 | 305 | ||
| 297 | (defun cus-test-get-autoload-deps () | 306 | (defun cus-test-get-autoload-deps () |
| 298 | "Return the list of files with autoloads." | 307 | "Return the list of files with autoloads." |
| @@ -313,7 +322,7 @@ Optional argument ALL non-nil means list all Lisp files." | |||
| 313 | ;; Hack to remove leading "./". | 322 | ;; Hack to remove leading "./". |
| 314 | (mapcar (lambda (e) (substring e 2)) | 323 | (mapcar (lambda (e) (substring e 2)) |
| 315 | (apply 'process-lines find-program | 324 | (apply 'process-lines find-program |
| 316 | "-name" "*.el" | 325 | "-name" "[^.]*.el" ; ignore .dir-locals.el |
| 317 | (unless all | 326 | (unless all |
| 318 | (list "-exec" grep-program | 327 | (list "-exec" grep-program |
| 319 | "-l" "^[ \t]*(defcustom" "{}" "+")))) | 328 | "-l" "^[ \t]*(defcustom" "{}" "+")))) |
| @@ -326,16 +335,21 @@ Optional argument ALL non-nil means list all Lisp files." | |||
| 326 | 335 | ||
| 327 | ;;; The routines for batch mode: | 336 | ;;; The routines for batch mode: |
| 328 | 337 | ||
| 329 | (defun cus-test-opts () | 338 | (defun cus-test-opts (&optional all) |
| 330 | "Test custom options. | 339 | "Test custom options. |
| 331 | This function is suitable for batch mode. E.g., invoke | 340 | This function is suitable for batch mode. E.g., invoke |
| 332 | 341 | ||
| 333 | src/emacs -batch -l admin/cus-test.el -f cus-test-opts | 342 | src/emacs -batch -l admin/cus-test.el -f cus-test-opts |
| 334 | 343 | ||
| 335 | in the Emacs source directory." | 344 | in the Emacs source directory. |
| 345 | Normally only tests options belonging to files in loaddefs.el. | ||
| 346 | If optional argument ALL is non-nil, test all files with defcustoms." | ||
| 336 | (interactive) | 347 | (interactive) |
| 348 | (and noninteractive | ||
| 349 | command-line-args-left | ||
| 350 | (setq all (pop command-line-args-left))) | ||
| 337 | (message "Running %s" 'cus-test-load-libs) | 351 | (message "Running %s" 'cus-test-load-libs) |
| 338 | (cus-test-load-libs) | 352 | (cus-test-load-libs (if all "defcustom")) |
| 339 | (message "Running %s" 'cus-test-load-custom-loads) | 353 | (message "Running %s" 'cus-test-load-custom-loads) |
| 340 | (cus-test-load-custom-loads) | 354 | (cus-test-load-custom-loads) |
| 341 | (message "Running %s" 'cus-test-apropos) | 355 | (message "Running %s" 'cus-test-apropos) |