unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52105: comp-tests.el causes byte-compiler warnings
@ 2021-11-25 14:10 Stephen Gildea
  2021-11-25 16:58 ` Andrea Corallo
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Gildea @ 2021-11-25 14:10 UTC (permalink / raw)
  To: 52105

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

Package: emacs
Version: 28.0.60
Tags: patch

The following small patch eliminates all the compile-time warnings
from comp-tests.el.

This patch is against the master branch, but since the patch changes only
test/, perhaps you would like me to re-work it for the emacs-28 branch.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: remove compiler warnings from comp-tests.el --]
[-- Type: text/x-diff, Size: 3289 bytes --]

diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 025bc2058e..16612965bd 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -27,14 +27,23 @@
 
 (require 'ert)
 (require 'ert-x)
-(require 'cl-lib)
-
-(defconst comp-test-src (ert-resource-file "comp-test-funcs.el"))
-
-(defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el"))
-
-(when (featurep 'native-compile)
+(eval-when-compile
+  (require 'cl-lib)
   (require 'comp)
+  (defconst comp-test-src (ert-resource-file "comp-test-funcs.el"))
+  (defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el"))
+  (defconst comp-test-pure-src (ert-resource-file "comp-test-pure.el"))
+  (defconst comp-test-45603-src (ert-resource-file "comp-test-45603.el")))
+(eval-and-compile
+  (require 'comp-cstr)          ;in eval-and-compile for its defstruct
+  ;; Load the test code here so the compiler can check the function
+  ;; names used in this file.
+  (load comp-test-src nil t)
+  (load comp-test-dyn-src nil t)
+  (load comp-test-pure-src nil t)
+  (load comp-test-45603-src nil t))
+
+(when (native-comp-available-p)
   (message "Compiling tests...")
   (load (native-compile comp-test-src))
   (load (native-compile comp-test-dyn-src)))
@@ -352,6 +361,8 @@ interactive-form
                                  comp-test-interactive-form2-f)))
   (should-not (commandp #'comp-tests-doc-f)))
 
+(declare-function comp-tests-free-fun-f nil)
+
 (comp-deftest free-fun ()
   "Check we are able to compile a single function."
   (eval '(defun comp-tests-free-fun-f ()
@@ -369,6 +380,8 @@ free-fun
   (should (equal (interactive-form #'comp-tests-free-fun-f)
                  '(interactive))))
 
+(declare-function comp-tests/free\fun-f nil)
+
 (comp-deftest free-fun-silly-name ()
   "Check we are able to compile a single function."
   (eval '(defun comp-tests/free\fun-f ()) t)
@@ -493,7 +506,7 @@ 45635-1
 
 (comp-deftest 45603-1 ()
   "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01994.html>"
-  (load (native-compile (ert-resource-file "comp-test-45603.el")))
+  (load (native-compile comp-test-45603-src))
   (should (fboundp #'comp-test-45603--file-local-name)))
 
 (comp-deftest 46670-1 ()
@@ -786,6 +799,8 @@ comp-tests-tco-checker
            (comp-tests-mentioned-p (comp-c-func-name 'comp-tests-tco-f "F" t)
                                    insn)))))))
 
+(declare-function comp-tests-tco-f nil)
+
 (comp-deftest tco ()
   "Check for tail recursion elimination."
   (let ((native-comp-speed 3)
@@ -814,6 +829,8 @@ comp-tests-fw-prop-checker-1
        (or (comp-tests-mentioned-p 'concat insn)
            (comp-tests-mentioned-p 'length insn)))))))
 
+(declare-function comp-tests-fw-prop-1-f nil)
+
 (comp-deftest fw-prop-1 ()
   "Some tests for forward propagation."
   (let ((native-comp-speed 2)
@@ -1404,7 +1421,7 @@ pure
   (let ((native-comp-speed 3)
         (comp-post-pass-hooks '((comp-final comp-tests-pure-checker-1
                                             comp-tests-pure-checker-2))))
-    (load (native-compile (ert-resource-file "comp-test-pure.el")))
+    (load (native-compile comp-test-pure-src))
 
     (should (subr-native-elisp-p (symbol-function #'comp-tests-pure-caller-f)))
     (should (= (comp-tests-pure-caller-f) 4))

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

* bug#52105: comp-tests.el causes byte-compiler warnings
  2021-11-25 14:10 bug#52105: comp-tests.el causes byte-compiler warnings Stephen Gildea
@ 2021-11-25 16:58 ` Andrea Corallo
  2021-11-25 18:20   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Corallo @ 2021-11-25 16:58 UTC (permalink / raw)
  To: Stephen Gildea; +Cc: 52105

Stephen Gildea <stepheng+emacs@gildea.com> writes:

> Package: emacs
> Version: 28.0.60
> Tags: patch
>
> The following small patch eliminates all the compile-time warnings
> from comp-tests.el.
>
> This patch is against the master branch, but since the patch changes only
> test/, perhaps you would like me to re-work it for the emacs-28 branch.

Hi Stephen,

thanks for the patch, LGTM.

For the emacs-28 subject I let Eli or Lars speak.

Regards

  Andrea






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

* bug#52105: comp-tests.el causes byte-compiler warnings
  2021-11-25 16:58 ` Andrea Corallo
@ 2021-11-25 18:20   ` Eli Zaretskii
  2021-11-29 16:04     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-11-25 18:20 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: stepheng+emacs, 52105

> From: Andrea Corallo <akrl@sdf.org>
> Date: Thu, 25 Nov 2021 16:58:51 +0000
> Cc: 52105@debbugs.gnu.org
> 
> > The following small patch eliminates all the compile-time warnings
> > from comp-tests.el.
> >
> > This patch is against the master branch, but since the patch changes only
> > test/, perhaps you would like me to re-work it for the emacs-28 branch.
> 
> Hi Stephen,
> 
> thanks for the patch, LGTM.
> 
> For the emacs-28 subject I let Eli or Lars speak.

I see no reason to install this on the release branch.  Master is
good enough, IMO.





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

* bug#52105: comp-tests.el causes byte-compiler warnings
  2021-11-25 18:20   ` Eli Zaretskii
@ 2021-11-29 16:04     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-29 16:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52105, stepheng+emacs, Andrea Corallo

Eli Zaretskii <eliz@gnu.org> writes:

> I see no reason to install this on the release branch.  Master is
> good enough, IMO.

And it seems like the patch was pushed, but the bug report was left
open, so I'm closing it now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-11-29 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 14:10 bug#52105: comp-tests.el causes byte-compiler warnings Stephen Gildea
2021-11-25 16:58 ` Andrea Corallo
2021-11-25 18:20   ` Eli Zaretskii
2021-11-29 16:04     ` Lars Ingebrigtsen

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