Subject: [bug#77681] [PATCH 6/6] gnu: emacs: Run tests.

From: Liliana Marie Prikler <[email-masked]>
Date: Wed, 09 Apr 2025 22:17:58 +0200

Am Mittwoch, dem 09.04.2025 um 15:01 -0400 schrieb Morgan Smith:
> * gnu/packages/emacs.scm
> (emacs-ert-selector): New function.
> (emacs-minimal): Run tests.
> (emacs-next-minimal): Run tests.
> (emacs-next-minimal): Run tests.
> (emacs->emacs-next): Run tests.
Looks like some changes here are duplicated.

> Change-Id: Ib5ffeae9b7f49b5f1a56d348c15ce4c4fb28f5ec
> ---
>  gnu/packages/emacs.scm | 89
> ++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 86 insertions(+), 3 deletions(-)
> 
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 9a020d89aa..fbde2bd913 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -98,6 +98,26 @@ (define (%emacs-modules build-system)
>        (srfi srfi-1)
>        (ice-9 ftw))))
>  
> +(define* (emacs-ert-selector excluded-tests #:key run-nativecomp
> run-expensive run-unstable)
> +  "Create an ERT selector that excludes tests."
> +  (string-append
> +   "(not (or "
> +   (if run-nativecomp
> +       ""
> +       "(tag :nativecomp) ")
> +   (if run-expensive
> +       ""
> +       "(tag :expensive-test) ")
> +   (if run-unstable
> +       ""
> +       "(tag :unstable) ")
> +   (string-join
> +    (map
> +     (lambda (test)
> +       (string-append "\\\"" test "\\\""))
> +     excluded-tests))
> +   "))"))
> +
>  (define-public emacs-minimal
>    (package
>      (name "emacs-minimal")
> @@ -153,9 +173,24 @@ (define-public emacs-minimal
>      (build-system gnu-build-system)
>      (arguments
>       (list
> -      #:tests? #f                       ; no check target
>        #:modules (%emacs-modules build-system)
>        #:configure-flags #~(list "--with-gnutls=no" "--disable-build-
> details")
> +      #:make-flags #~(list
> +                      ;; Broken tests.  This is inherited by other
> Emacs
> +                      ;; packages so test them all when changing
> this value
> +                      (string-append
> +                       "SELECTOR="
> +                       #$(emacs-ert-selector
> +                          '("esh-util-test/path/get-remote"
> +                            "esh-var-test/path-var/preserve-across-
> hosts"
> +                            "ffap-tests--c-path"
> +                            "grep-tests--rgrep-abbreviate-
> properties-darwin"
> +                            "grep-tests--rgrep-abbreviate-
> properties-gnu-linux"
> +                            "grep-tests--rgrep-abbreviate-
> properties-windows-nt-dos-semantics"
> +                            "grep-tests--rgrep-abbreviate-
> properties-windows-nt-sh-semantics"
> +                            "info-xref-test-makeinfo"
> +                            "man-tests-find-header-file"
> +                            "tramp-test48-remote-load-path"))))
Can we bind this selector (or one of its supersets below) to a variable
so as to use (string-append "SELECTOR=" %selector)?  

Cheers