unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch
@ 2024-02-04  3:37 Corwin Brust
  2024-02-04  3:41 ` corwin
  0 siblings, 1 reply; 5+ messages in thread
From: Corwin Brust @ 2024-02-04  3:37 UTC (permalink / raw)
  To: 68919

Severity: minor
Tags: patch
thanks

It would be nice to be able to run the feature tests for the Windows
port in batch mode.

emacs.exe -l etc/w32-feature.el --batch -eval \
  '(ert-run-tests-batch-and-exit)'

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'.


In GNU Emacs 30.0.50 (build 1, x86_64-w64-mingw32) of 2024-02-03 built
 on AVALON
Repository revision: 4ebded3f5ee8617ac6b1debaa01706cd78206f39
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Home (v10.0.2009.19045.3996)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation
 --without-compress-install --with-tree-sitter CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp-run bytecomp
byte-compile comp-common rx time-date subr-x cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty
move-toolbar make-network-process native-compile emacs)

Memory information:
((conses 16 61441 24999) (symbols 48 5987 0) (strings 32 17339 1819)
 (string-bytes 1 551266) (vectors 16 9770)
 (vector-slots 8 141106 10976) (floats 8 25 37) (intervals 56 257 0)
 (buffers 984 11))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch
  2024-02-04  3:37 bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch Corwin Brust
@ 2024-02-04  3:41 ` corwin
  2024-02-04  7:08   ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: corwin @ 2024-02-04  3:41 UTC (permalink / raw)
  To: 68919

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-etc-w32-feature.el-harfbuzz-skip-unless-display-grap.patch --]
[-- Type: text/x-diff; name=0001-etc-w32-feature.el-harfbuzz-skip-unless-display-grap.patch, Size: 1059 bytes --]

From 65bc247c664793cb2c9a21aae396d98ef5a50238 Mon Sep 17 00:00:00 2001
From: Corwin Brust <corwin@bru.st>
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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch
  2024-02-04  3:41 ` corwin
@ 2024-02-04  7:08   ` Eli Zaretskii
  2024-02-04 15:25     ` Corwin Brust
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-02-04  7:08 UTC (permalink / raw)
  To: corwin; +Cc: 68919

> Date: Sat, 03 Feb 2024 21:41:34 -0600
> From: corwin@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch
  2024-02-04  7:08   ` Eli Zaretskii
@ 2024-02-04 15:25     ` Corwin Brust
  2024-02-04 15:34       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Corwin Brust @ 2024-02-04 15:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 68919

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

On Sun, Feb 4, 2024 at 1:08 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> 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
>

Thank you, Eli - let me know if this is better.  (Should we continue
using frame-parameters in when display-graphic-p is t?  I assume not;
this works in both cases and is thus better because it's simpler, or
so I have thought.)

[-- Attachment #2: 0001-etc-w32-feature.el-harfbuzz-improve-test.patch --]
[-- Type: application/octet-stream, Size: 880 bytes --]

From 6ea7ff780437d3abeb768f8ba1f6ee21b9d70d18 Mon Sep 17 00:00:00 2001
From: Corwin Brust <corwin@bru.st>
Date: Sat, 3 Feb 2024 20:54:29 -0600
Subject: [PATCH] ; etc/w32-feature.el (harfbuzz): improve test

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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/etc/w32-feature.el b/etc/w32-feature.el
index 8d36e32e0fb..08124d396cb 100644
--- a/etc/w32-feature.el
+++ b/etc/w32-feature.el
@@ -46,9 +46,7 @@ feature-optimization
 
 (ert-deftest feature-harfbuzz ()
   (should
-   (eq
-    'harfbuzz
-    (car (frame-parameter nil 'font-backend)))))
+   (eq 'harfbuzz (get 'uniscribe 'font-driver-superseded-by))))
 
 (ert-deftest feature-gnutls ()
   (should (gnutls-available-p)))
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch
  2024-02-04 15:25     ` Corwin Brust
@ 2024-02-04 15:34       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2024-02-04 15:34 UTC (permalink / raw)
  To: Corwin Brust; +Cc: 68919

> From: Corwin Brust <corwin@bru.st>
> Date: Sun, 4 Feb 2024 09:25:32 -0600
> Cc: 68919@debbugs.gnu.org
> 
> On Sun, Feb 4, 2024 at 1:08 AM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > 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
> >
> 
> Thank you, Eli - let me know if this is better.

LGTM, thanks.

> (Should we continue using frame-parameters in when display-graphic-p
> is t?  I assume not; this works in both cases and is thus better
> because it's simpler, or so I have thought.)

Yes, for this particular feature there's no need to use
frame-parameters anymore, since the above test works in all kinds of
session.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-04 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04  3:37 bug#68919: 30.0.50; etc/w32-feature.el: tests do not work under --batch Corwin Brust
2024-02-04  3:41 ` corwin
2024-02-04  7:08   ` Eli Zaretskii
2024-02-04 15:25     ` Corwin Brust
2024-02-04 15:34       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).