Improve ert-resource-directory docstring
* lisp/emacs-lisp/ert-x.el (ert-resource-directory): Improve docstring.
This commit is contained in:
parent
a8f04014c2
commit
6ad628b865
1 changed files with 9 additions and 8 deletions
|
@ -363,18 +363,19 @@ convert it to a string and pass it to COLLECTOR first."
|
|||
|
||||
;; Has to be a macro for `load-file-name'.
|
||||
(defmacro ert-resource-directory ()
|
||||
"Return absolute file name of the resource directory for this file.
|
||||
"Return absolute file name of the resource (test data) directory.
|
||||
|
||||
The path to the resource directory is the \"resources\" directory
|
||||
in the same directory as the test file.
|
||||
in the same directory as the test file this is called from.
|
||||
|
||||
If that directory doesn't exist, use the directory named like the
|
||||
test file but formatted by `ert-resource-directory-format' and trimmed
|
||||
using `string-trim' with arguments
|
||||
If that directory doesn't exist, find a directory based on the
|
||||
test file name. If the file is named \"foo-tests.el\", return
|
||||
the absolute file name for \"foo-resources\". If you want a
|
||||
different resource directory naming scheme, set the variable
|
||||
`ert-resource-directory-format'. Before formatting, the file
|
||||
name will be trimmed using `string-trim' with arguments
|
||||
`ert-resource-directory-trim-left-regexp' and
|
||||
`ert-resource-directory-trim-right-regexp'. The default values mean
|
||||
that if called from a test file named \"foo-tests.el\", return
|
||||
the absolute file name for \"foo-resources\"."
|
||||
`ert-resource-directory-trim-right-regexp'."
|
||||
`(let* ((testfile ,(or (bound-and-true-p byte-compile-current-file)
|
||||
(and load-in-progress load-file-name)
|
||||
buffer-file-name))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue