commit:     e1411e05184086ea6b91a20e5dc7bdd4795f3b5f
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  3 16:38:32 2023 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Tue Apr 18 00:35:46 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1411e05

eclass/elisp.eclass: add elisp_src_test

Closes: https://bugs.gentoo.org/898492
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 eclass/elisp.eclass | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass
index 192f27384967..1ac1a2dbfabf 100644
--- a/eclass/elisp.eclass
+++ b/eclass/elisp.eclass
@@ -9,6 +9,7 @@
 # Jeremy Maitin-Shepard <[email protected]>
 # Christian Faulhammer <[email protected]>
 # Ulrich Müller <[email protected]>
+# Maciej Barć <[email protected]>
 # @SUPPORTED_EAPIS: 7 8
 # @PROVIDES: elisp-common
 # @BLURB: Eclass for Emacs Lisp packages
@@ -142,6 +143,19 @@ elisp_src_compile() {
        fi
 }
 
+# @FUNCTION: elisp_src_test
+# @DESCRIPTION:
+# Call "elisp-test" to test the package if "elisp-enable-tests" was called
+# beforehand, otherwise execute the default test function - "src_test".
+
+elisp_src_test() {
+       if [[ ${_ELISP_TEST_FUNCTION} ]]; then
+               elisp-test
+       else
+               default_src_test
+       fi
+}
+
 # @FUNCTION: elisp_src_install
 # @DESCRIPTION:
 # Call elisp-install to install all Emacs Lisp (*.el and *.elc) files.
@@ -187,5 +201,5 @@ elisp_pkg_postrm() {
        elisp-site-regen
 }
 
-EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \
+EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,test,install} \
        pkg_{setup,postinst,postrm}

Reply via email to