File 9525-Update-emacs_SUITE-to-require-Emacs-27.1.patch of Package erlang
From 06bc9eba8e5baff4195f6b10dbdf3ba874ef8c60 Mon Sep 17 00:00:00 2001
From: Bozhidar Batsov <bozhidar@batsov.dev>
Date: Fri, 20 Mar 2026 13:39:09 +0200
Subject: [PATCH 15/17] Update emacs_SUITE to require Emacs 27.1+
- Bump the minimum version check in init_per_testcase from 24.3 to 27.1
- Remove the erldoc.el skip for Emacs < 24.3 (cl-lib is always available)
- Remove byte-compile warning workarounds for Emacs < 26
- Remove version guards around tests_interpreted/tests_compiled since
init_per_testcase already ensures the minimum version
---
lib/tools/test/emacs_SUITE.erl | 44 ++++++++--------------------------
1 file changed, 10 insertions(+), 34 deletions(-)
diff --git a/lib/tools/test/emacs_SUITE.erl b/lib/tools/test/emacs_SUITE.erl
index 7f0a06dfda..917aaf683a 100644
--- a/lib/tools/test/emacs_SUITE.erl
+++ b/lib/tools/test/emacs_SUITE.erl
@@ -41,7 +41,7 @@ init_per_testcase(Case, Config) ->
ErlangEl = filename:join([code:lib_dir(tools),"emacs","erlang.el"]),
case file:read_file_info(ErlangEl) of
{ok, _} ->
- case Case =:= bif_highlight orelse emacs_version_ok(24.3) of
+ case Case =:= bif_highlight orelse emacs_version_ok(27.1) of
false -> {skip, "Old or no emacs found"};
_ -> [{el, ErlangEl}|Config]
end;
@@ -95,28 +95,12 @@ load_interpreted(_Config) ->
compile_and_load(_Config) ->
Dir = emacs_dir(),
- Files0 = filelib:wildcard("*.el", Dir),
- Files = case emacs_version_ok(24.3) of
- %% erldoc.el depends on cl-lib which was introduced in 24.3.
- false -> Files0 -- ["erldoc.el"];
- _ -> Files0
- end,
- Unforgiving =
- case emacs_version_ok(24) of
- Ver when Ver < 25 ->
- "";
- Ver when Ver < 26 ->
- %% Workaround byte-compile-error-on-warn which seem broken in
- %% Emacs 25.
- "\"(advice-add #'display-warning :after "
- "(lambda (_ f &optional _ _) (error \\\"%s\\\" f)))\"";
- _ ->
- "\"(setq byte-compile-error-on-warn t)\""
- end,
+ Files = filelib:wildcard("*.el", Dir),
+ Unforgiving = "\"(setq byte-compile-error-on-warn t)\"",
%% Add files here whenever they are cleaned of warnings.
NoWarn = ["erlang.el", "erlang-test.el", "erlang-edoc.el", "erlang-start.el", "erldoc.el"],
Compile = fun(File) ->
- Pedantic = case lists:member(File, NoWarn) andalso Unforgiving /= "" of
+ Pedantic = case lists:member(File, NoWarn) of
true -> ["--eval ", Unforgiving, " "];
false -> " "
end,
@@ -129,22 +113,14 @@ compile_and_load(_Config) ->
ok.
tests_interpreted(_Config) ->
- case emacs_version_ok(25) of
- false -> {skip, "Old or no emacs found"};
- _ ->
- emacs(["-l erlang.el ",
- "-l erlang-test.el -f ert-run-tests-batch-and-exit"]),
- ok
- end.
+ emacs(["-l erlang.el ",
+ "-l erlang-test.el -f ert-run-tests-batch-and-exit"]),
+ ok.
tests_compiled(_Config) ->
- case emacs_version_ok(25) of
- false -> {skip, "Old or no emacs found"};
- _ ->
- emacs(["-l erlang.elc ",
- "-l erlang-test.elc -f ert-run-tests-batch-and-exit"]),
- ok
- end.
+ emacs(["-l erlang.elc ",
+ "-l erlang-test.elc -f ert-run-tests-batch-and-exit"]),
+ ok.
dquote(Str) ->
--
2.51.0