GNU bug report logs - #68919
30.0.50; etc/w32-feature.el: tests do not work under --batch

Previous Next

Package: emacs;

Reported by: Corwin Brust <corwin <at> bru.st>

Date: Sun, 4 Feb 2024 03:38:01 UTC

Severity: minor

Tags: patch

Found in version 30.0.50

Done: Corwin Brust <corwin <at> bru.st>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 68919 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: corwin <at> bru.st
Cc: 68919 <at> debbugs.gnu.org
Subject: Re: bug#68919: 30.0.50;
 etc/w32-feature.el: tests do not work under --batch
Date: Sun, 04 Feb 2024 09:08:56 +0200
> Date: Sat, 03 Feb 2024 21:41:34 -0600
> From: corwin <at> bru.st
> 
> On 2024-02-03 21:37, Corwin Brust wrote:
> > 
> > This currently fails because the harfbuzz test is ungated: it runs
> > irrespective of whether a (graphical) display is attached.  Once I
> > receive a confirmation with this Bug# for the commit message, I'll
> > send along a tiny patch to address this using `display-graphic-p'.
> > 
> 
> Patch is attached
> 
> diff --git a/etc/w32-feature.el b/etc/w32-feature.el
> index 8d36e32e0fb..3bd818ea6ea 100644
> --- a/etc/w32-feature.el
> +++ b/etc/w32-feature.el
> @@ -45,10 +45,12 @@ feature-optimization
>     (string-match-p "CFLAGS=-O2" system-configuration-options)))
>  
>  (ert-deftest feature-harfbuzz ()
> -  (should
> -   (eq
> -    'harfbuzz
> -    (car (frame-parameter nil 'font-backend)))))
> +  (if (display-graphic-p)
> +      (should
> +       (eq
> +	'harfbuzz
> +	(car (frame-parameter nil 'font-backend))))
> +    (ert-skip "No graphic display")))

We can do better than this, I think.  The following works in batch
mode:

  emacs -batch --eval "(message \"%s\" (get 'uniscribe 'font-driver-superseded-by))"
   => harfbuzz

So I suggest to rewrite the above test to use this technique.  See
syms_of_w32uniscribe_for_pdumper for the details: the above will only
yield 'harfbuzz' if Emacs was built with HarfBuzz support and
succeeded to load the HarfBuzz DLL at run time.




This bug report was last modified 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.