From 6ad628b8657d840de1c9ac07e653d945e2a88889 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 2 Nov 2020 19:06:46 +0100 Subject: [PATCH] Improve ert-resource-directory docstring * lisp/emacs-lisp/ert-x.el (ert-resource-directory): Improve docstring. --- lisp/emacs-lisp/ert-x.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index abbff6da625..a8da2c413e0 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -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. - -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)) -- 2.39.2