2017-06-08 11:47:56 +02:00
|
|
|
;;; core/autoload/test.el -*- lexical-binding: t; -*-
|
2017-04-04 22:18:38 -04:00
|
|
|
|
|
|
|
;;;###autoload
|
2017-06-14 20:26:17 +02:00
|
|
|
(defmacro def-test! (name &rest body)
|
|
|
|
"Define a namespaced ERT test."
|
|
|
|
(declare (indent defun) (doc-string 2))
|
2017-04-12 10:52:42 -04:00
|
|
|
(unless (plist-get body :disabled)
|
2017-06-14 20:26:17 +02:00
|
|
|
`(ert-deftest
|
|
|
|
,(cl-loop with path = (file-relative-name (file-name-sans-extension load-file-name)
|
|
|
|
doom-emacs-dir)
|
|
|
|
for (rep . with) in '(("/test/" . "/") ("/" . ":"))
|
|
|
|
do (setq path (replace-regexp-in-string rep with path t t))
|
|
|
|
finally return (intern (format "%s::%s" path name))) ()
|
|
|
|
()
|
|
|
|
,@body)))
|