Signed-off-by: Maciej Barć <x...@gentoo.org>
---
 eclass/elisp.eclass | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass
index 192f27384..1ac1a2dbf 100644
--- a/eclass/elisp.eclass
+++ b/eclass/elisp.eclass
@@ -9,6 +9,7 @@
 # Jeremy Maitin-Shepard <j...@attbi.com>
 # Christian Faulhammer <fa...@gentoo.org>
 # Ulrich Müller <u...@gentoo.org>
+# Maciej Barć <x...@gentoo.org>
 # @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}
-- 
2.39.2


Reply via email to