Subject: Re: bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch

From: [email-masked]
Date: Sat, 03 Feb 2024 21:41:34 -0600

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

From 65bc247c664793cb2c9a21aae396d98ef5a50238 Mon Sep 17 00:00:00 2001
From: Corwin Brust <[email-masked]>
Date: Sat, 3 Feb 2024 20:54:29 -0600
Subject: [PATCH] ; etc/w32-feature.el (harfbuzz): skip unless
 display-graphic-p

This enable the tests to be used with batch (Bug#68919), e.g.

emacs.exe -l etc/w32-feature.el --batch -eval \
  '(ert-run-tests-batch-and-exit)'
---
 etc/w32-feature.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

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")))
 
 (ert-deftest feature-gnutls ()
   (should (gnutls-available-p)))
-- 
2.36.1