General & minor refactor+cleanup

This commit is contained in:
Henrik Lissner 2017-11-05 17:16:13 +01:00
parent 0c2b1b5a93
commit c45e2c4918
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 33 additions and 35 deletions

View file

@ -16,19 +16,18 @@ If neither is available, run all tests in all enabled modules."
(load (expand-file-name "core/core.el" user-emacs-directory) nil t)
(doom-initialize-modules nil))
;; collect targets
(cond ((and command-line-args-left
(equal (car command-line-args-left) "--"))
(cl-loop for arg in (cdr argv)
(cond ((and argv (equal (car argv) "--"))
(cl-loop for arg in argv
if (equal arg "core")
do (push (expand-file-name "test/" doom-core-dir) targets)
do (push (expand-file-name "test/" doom-core-dir) targets)
else
collect
(cl-destructuring-bind (car &optional cdr) (split-string arg "/" t)
(cons (intern (concat ":" car))
(and cdr (intern cdr))))
into args
finally do (setq modules args
command-line-args-left nil)))
collect
(cl-destructuring-bind (car &optional cdr) (split-string arg "/" t)
(cons (intern (concat ":" car))
(and cdr (intern cdr))))
into args
finally do
(setq modules args argv nil)))
(modules
(unless (cl-loop for module in modules
@ -58,8 +57,8 @@ If neither is available, run all tests in all enabled modules."
collect (expand-file-name "test/" path))))
for dir in targets
if (file-directory-p dir)
nconc (reverse (directory-files-recursively dir "\\.el$"))
into items
nconc (reverse (directory-files-recursively dir "\\.el$"))
into items
finally do (quiet! (mapc #'load-file items)))
;; run all loaded tests
(when noninteractive