(defun ert-test-boundp (symbol)
"Return non-nil if SYMBOL names a test."
- (and (get symbol 'ert--test) t))
+ (get symbol 'ert-deftest))
(defun ert-get-test (symbol)
"If SYMBOL names a test, return that. Signal an error otherwise."
- (unless (ert-test-boundp symbol) (error "No test named `%S'" symbol))
- (get symbol 'ert--test))
+ (or (ert-test-boundp symbol) (error "No test named `%S'" symbol)))
(defun ert-set-test (symbol definition)
"Make SYMBOL name the test DEFINITION, and return DEFINITION."
;; Note that nil is still a valid value for the `name' slot in
;; ert-test objects. It designates an anonymous test.
(error "Attempt to define a test named nil"))
- (when (and noninteractive (get symbol 'ert--test))
+ (when (and noninteractive (ert-test-boundp symbol))
;; Make sure duplicated tests are discovered since the older test would
;; be ignored silently otherwise.
(error "Test `%s' redefined (or loaded twice)" symbol))
- (define-symbol-prop symbol 'ert--test definition)
+ (define-symbol-prop symbol 'ert-deftest definition)
definition)
(defun ert-make-test-unbound (symbol)
"Make SYMBOL name no test. Return SYMBOL."
- (cl-remprop symbol 'ert--test)
+ (cl-remprop symbol 'ert-deftest)
symbol)
(defun ert--parse-keys-and-body (keys-and-body)
;; 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-file (symbol-file symbol 'ert-deftest))
(test-report
(file-name-with-extension
(or ert-load-file-name test-file) "xml")))
(insert (if test-name (format "%S" test-name) "<anonymous test>"))
(insert " is a test")
(let ((file-name (and test-name
- (symbol-file test-name 'ert--test))))
+ (symbol-file test-name 'ert-deftest))))
(when file-name
(insert (format-message " defined in `%s'"
(file-name-nondirectory file-name)))
(let ((abc (ert-get-test 'ert-test-abc)))
(should (equal (ert-test-tags abc) '(bar)))
(should (equal (ert-test-documentation abc) "foo")))
- (should (equal (symbol-file 'ert-test-deftest 'ert--test)
+ (should (equal (symbol-file 'ert-test-deftest 'ert-deftest)
(symbol-file 'ert-test--which-file 'defun)))
(ert-deftest ert-test-def () :expected-result ':passed)
(insert buf)))
(kill-emacs (ert-stats-completed-unexpected stats))))))
;; The `ert-test' object in Emacs 29 has a `file-name' field.
- (file-name (symbol-file name 'ert--test))
+ (file-name (symbol-file name 'ert-deftest))
(default-directory (expand-file-name (file-name-directory file-name)))
(package (if-let* ((found (getenv "ERC_PACKAGE_NAME"))
((string-prefix-p "erc-" found)))
"Set the documentation string for a derived test.
The test is derived from TEST and COMMAND."
(let ((test-doc
- (split-string (ert-test-documentation (get test 'ert--test)) "\n")))
+ (split-string (ert-test-documentation (get test 'ert-deftest)) "\n")))
;; The first line must be extended.
(setcar
test-doc (format "%s Use the \"%s\" command." (car test-doc) command))
(setf (ert-test-documentation
- (get (intern (format "%s-with-%s" test command)) 'ert--test))
+ (get (intern (format "%s-with-%s" test command)) 'ert-deftest))
(string-join test-doc "\n"))))
(defmacro tramp--test-deftest-with-stat (test)
:tags '(:expensive-test)
(let ((test-doc
(split-string
- (ert-test-documentation (get ',test 'ert--test)) "\n")))
+ (ert-test-documentation (get ',test 'ert-deftest)) "\n")))
;; The first line must be extended.
(setcar
test-doc
(setf (ert-test-documentation
(get
(intern (format "%s-without-file-attributes" ',test))
- 'ert--test))
+ 'ert-deftest))
(string-join test-doc "\n")))
(skip-unless (tramp--test-enabled))
(skip-unless
`(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) ()
;; This is the docstring. However, it must be expanded to a
;; string inside the macro. No idea.
- ;; (concat (ert-test-documentation (get ',test 'ert--test))
+ ;; (concat (ert-test-documentation (get ',test 'ert-deftest))
;; "\nUse direct async process.")
:tags (append '(:expensive-test :tramp-asynchronous-processes)
(and ,unstable '(:unstable)))