;; 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.
-
-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
+in the same directory as the test file this is called from.
+
+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))