diff options
| author | Basil L. Contovounesios | 2020-06-02 23:14:23 +0100 |
|---|---|---|
| committer | Basil L. Contovounesios | 2020-06-03 01:22:41 +0100 |
| commit | 7d323f07c0b540547c4aab38069972a918eff9d3 (patch) | |
| tree | e2b2d6c7051e6f57e230a65e97993d75731cd517 | |
| parent | cf473e742fdd0cce75f8e43a62307612b929461d (diff) | |
| download | emacs-7d323f07c0b540547c4aab38069972a918eff9d3.tar.gz emacs-7d323f07c0b540547c4aab38069972a918eff9d3.zip | |
Silence some byte-compiler warnings in tests
* test/lisp/emacs-lisp/cl-generic-tests.el:
* test/lisp/progmodes/elisp-mode-tests.el: Declare functions
referred to within macroexpansions.
(xref-elisp-overloadable-no-default)
(xref-elisp-overloadable-co-located-default)
(xref-elisp-overloadable-separate-default): Prefix unused arguments
with underscore.
* test/lisp/international/ccl-tests.el:
* test/lisp/wdired-tests.el:
* test/lisp/emacs-lisp/package-tests.el: Declare functions used.
(package-test-update-archives, package-test-signed): Use
revert-buffer in place of its obsolete alias package-menu-refresh.
* test/lisp/eshell/eshell-tests.el:
* test/lisp/mail/footnote-tests.el:
* test/src/buffer-tests.el: Require dependencies used.
* test/lisp/image/exif-tests.el: Remove unneeded (require 'seq).
(test-exit-direct-ascii-value): Actually perform the test.
* test/lisp/progmodes/sql-tests.el (sql-test-add-existing-product):
Fix typo.
* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer):
* test/src/data-tests.el (test-bool-vector-bv-from-hex-string)
(test-bool-vector-apply-mock-op): Remove unused local variables.
| -rw-r--r-- | test/lisp/emacs-lisp/cl-generic-tests.el | 8 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/package-tests.el | 13 | ||||
| -rw-r--r-- | test/lisp/eshell/eshell-tests.el | 1 | ||||
| -rw-r--r-- | test/lisp/image/exif-tests.el | 5 | ||||
| -rw-r--r-- | test/lisp/international/ccl-tests.el | 3 | ||||
| -rw-r--r-- | test/lisp/mail/footnote-tests.el | 6 | ||||
| -rw-r--r-- | test/lisp/progmodes/elisp-mode-tests.el | 11 | ||||
| -rw-r--r-- | test/lisp/progmodes/sql-tests.el | 2 | ||||
| -rw-r--r-- | test/lisp/simple-tests.el | 3 | ||||
| -rw-r--r-- | test/lisp/wdired-tests.el | 2 | ||||
| -rw-r--r-- | test/src/buffer-tests.el | 1 | ||||
| -rw-r--r-- | test/src/data-tests.el | 6 |
12 files changed, 38 insertions, 23 deletions
diff --git a/test/lisp/emacs-lisp/cl-generic-tests.el b/test/lisp/emacs-lisp/cl-generic-tests.el index d9f1cb9ec43..51c9884ddc8 100644 --- a/test/lisp/emacs-lisp/cl-generic-tests.el +++ b/test/lisp/emacs-lisp/cl-generic-tests.el | |||
| @@ -23,9 +23,15 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Code: | 24 | ;;; Code: |
| 25 | 25 | ||
| 26 | (eval-when-compile (require 'ert)) ;Don't indirectly require cl-lib at run-time. | ||
| 27 | (require 'cl-generic) | 26 | (require 'cl-generic) |
| 28 | 27 | ||
| 28 | ;; Don't indirectly require `cl-lib' at run-time. | ||
| 29 | (eval-when-compile (require 'ert)) | ||
| 30 | (declare-function ert--should-signal-hook "ert") | ||
| 31 | (declare-function ert--signal-should-execution "ert") | ||
| 32 | (declare-function ert-fail "ert") | ||
| 33 | (declare-function ert-set-test "ert") | ||
| 34 | |||
| 29 | (fmakunbound 'cl--generic-1) | 35 | (fmakunbound 'cl--generic-1) |
| 30 | (cl-defgeneric cl--generic-1 (x y)) | 36 | (cl-defgeneric cl--generic-1 (x y)) |
| 31 | (cl-defgeneric (setf cl--generic-1) (v y z) "My generic doc.") | 37 | (cl-defgeneric (setf cl--generic-1) (v y z) "My generic doc.") |
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 7d354d6ecde..4fcaf0e84c2 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el | |||
| @@ -267,6 +267,9 @@ Must called from within a `tar-mode' buffer." | |||
| 267 | (should (package-installed-p 'simple-single)) | 267 | (should (package-installed-p 'simple-single)) |
| 268 | (should (package-installed-p 'simple-depend)))) | 268 | (should (package-installed-p 'simple-depend)))) |
| 269 | 269 | ||
| 270 | (declare-function macro-problem-func "macro-problem" ()) | ||
| 271 | (declare-function macro-problem-10-and-90 "macro-problem" ()) | ||
| 272 | |||
| 270 | (ert-deftest package-test-macro-compilation () | 273 | (ert-deftest package-test-macro-compilation () |
| 271 | "Install a package which includes a dependency." | 274 | "Install a package which includes a dependency." |
| 272 | (with-package-test (:basedir "package-resources") | 275 | (with-package-test (:basedir "package-resources") |
| @@ -391,7 +394,7 @@ Must called from within a `tar-mode' buffer." | |||
| 391 | "Test updating package archives." | 394 | "Test updating package archives." |
| 392 | (with-package-test () | 395 | (with-package-test () |
| 393 | (let ((buf (package-list-packages))) | 396 | (let ((buf (package-list-packages))) |
| 394 | (package-menu-refresh) | 397 | (revert-buffer) |
| 395 | (search-forward-regexp "^ +simple-single") | 398 | (search-forward-regexp "^ +simple-single") |
| 396 | (package-menu-mark-install) | 399 | (package-menu-mark-install) |
| 397 | (package-menu-execute) | 400 | (package-menu-execute) |
| @@ -399,7 +402,7 @@ Must called from within a `tar-mode' buffer." | |||
| 399 | (let ((package-test-data-dir | 402 | (let ((package-test-data-dir |
| 400 | (expand-file-name "package-resources/newer-versions" package-test-file-dir))) | 403 | (expand-file-name "package-resources/newer-versions" package-test-file-dir))) |
| 401 | (setq package-archives `(("gnu" . ,package-test-data-dir))) | 404 | (setq package-archives `(("gnu" . ,package-test-data-dir))) |
| 402 | (package-menu-refresh) | 405 | (revert-buffer) |
| 403 | 406 | ||
| 404 | ;; New version should be available and old version should be installed | 407 | ;; New version should be available and old version should be installed |
| 405 | (goto-char (point-min)) | 408 | (goto-char (point-min)) |
| @@ -411,7 +414,7 @@ Must called from within a `tar-mode' buffer." | |||
| 411 | 414 | ||
| 412 | (package-menu-mark-upgrades) | 415 | (package-menu-mark-upgrades) |
| 413 | (package-menu-execute) | 416 | (package-menu-execute) |
| 414 | (package-menu-refresh) | 417 | (revert-buffer) |
| 415 | (should (package-installed-p 'simple-single '(1 4))))))) | 418 | (should (package-installed-p 'simple-single '(1 4))))))) |
| 416 | 419 | ||
| 417 | (ert-deftest package-test-update-archives-async () | 420 | (ert-deftest package-test-update-archives-async () |
| @@ -541,6 +544,8 @@ Must called from within a `tar-mode' buffer." | |||
| 541 | (let ((process-environment | 544 | (let ((process-environment |
| 542 | (cons (concat "HOME=" homedir) | 545 | (cons (concat "HOME=" homedir) |
| 543 | process-environment))) | 546 | process-environment))) |
| 547 | (require 'epg-config) | ||
| 548 | (defvar epg-config--program-alist) | ||
| 544 | (epg-find-configuration | 549 | (epg-find-configuration |
| 545 | 'OpenPGP nil | 550 | 'OpenPGP nil |
| 546 | ;; By default we require gpg2 2.1+ due to some | 551 | ;; By default we require gpg2 2.1+ due to some |
| @@ -573,7 +578,7 @@ Must called from within a `tar-mode' buffer." | |||
| 573 | (should (progn (package-install 'signed-bad) 'noerror))) | 578 | (should (progn (package-install 'signed-bad) 'noerror))) |
| 574 | ;; Check if the installed package status is updated. | 579 | ;; Check if the installed package status is updated. |
| 575 | (let ((buf (package-list-packages))) | 580 | (let ((buf (package-list-packages))) |
| 576 | (package-menu-refresh) | 581 | (revert-buffer) |
| 577 | (should (re-search-forward | 582 | (should (re-search-forward |
| 578 | "^\\s-+signed-good\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-" | 583 | "^\\s-+signed-good\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-" |
| 579 | nil t)) | 584 | nil t)) |
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 026818ab067..70694309443 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | ;;; Code: | 26 | ;;; Code: |
| 27 | 27 | ||
| 28 | (require 'ert) | 28 | (require 'ert) |
| 29 | (require 'esh-mode) | ||
| 29 | (require 'eshell) | 30 | (require 'eshell) |
| 30 | 31 | ||
| 31 | (defmacro with-temp-eshell (&rest body) | 32 | (defmacro with-temp-eshell (&rest body) |
diff --git a/test/lisp/image/exif-tests.el b/test/lisp/image/exif-tests.el index 8a2231106f0..9e5da46b508 100644 --- a/test/lisp/image/exif-tests.el +++ b/test/lisp/image/exif-tests.el | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | 21 | ||
| 22 | (require 'ert) | 22 | (require 'ert) |
| 23 | (require 'exif) | 23 | (require 'exif) |
| 24 | (require 'seq) | ||
| 25 | 24 | ||
| 26 | (defun test-image-file (name) | 25 | (defun test-image-file (name) |
| 27 | (expand-file-name | 26 | (expand-file-name |
| @@ -49,7 +48,7 @@ | |||
| 49 | (should (equal (exif-elem exif 'artist) "z")))) | 48 | (should (equal (exif-elem exif 'artist) "z")))) |
| 50 | 49 | ||
| 51 | (ert-deftest test-exit-direct-ascii-value () | 50 | (ert-deftest test-exit-direct-ascii-value () |
| 52 | (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0)) | 51 | (should (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0))) |
| 53 | (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0))) | 52 | (should (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0)))) |
| 54 | 53 | ||
| 55 | ;;; exif-tests.el ends here | 54 | ;;; exif-tests.el ends here |
diff --git a/test/lisp/international/ccl-tests.el b/test/lisp/international/ccl-tests.el index 3581cd784f0..c8a5512d6f0 100644 --- a/test/lisp/international/ccl-tests.el +++ b/test/lisp/international/ccl-tests.el | |||
| @@ -94,6 +94,9 @@ At EOF: | |||
| 94 | (ccl-dump prog-pgg-code) | 94 | (ccl-dump prog-pgg-code) |
| 95 | (should (equal (buffer-string) prog-pgg-dump)))) | 95 | (should (equal (buffer-string) prog-pgg-dump)))) |
| 96 | 96 | ||
| 97 | (defvar pgg-parse-crc24) | ||
| 98 | (declare-function pgg-parse-crc24-string "pgg-parse" (string)) | ||
| 99 | |||
| 97 | (ert-deftest pgg-parse-crc24 () | 100 | (ert-deftest pgg-parse-crc24 () |
| 98 | ;; Compiler | 101 | ;; Compiler |
| 99 | (require 'pgg) | 102 | (require 'pgg) |
diff --git a/test/lisp/mail/footnote-tests.el b/test/lisp/mail/footnote-tests.el index 458964c306e..79f48072391 100644 --- a/test/lisp/mail/footnote-tests.el +++ b/test/lisp/mail/footnote-tests.el | |||
| @@ -18,12 +18,10 @@ | |||
| 18 | ;; You should have received a copy of the GNU General Public License | 18 | ;; You should have received a copy of the GNU General Public License |
| 19 | ;; along with this program. If not, see <https://www.gnu.org/licenses/>. | 19 | ;; along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | 20 | ||
| 21 | ;;; Commentary: | ||
| 22 | |||
| 23 | ;; | ||
| 24 | |||
| 25 | ;;; Code: | 21 | ;;; Code: |
| 26 | 22 | ||
| 23 | (require 'footnote) | ||
| 24 | |||
| 27 | (ert-deftest footnote-tests-same-place () | 25 | (ert-deftest footnote-tests-same-place () |
| 28 | (with-temp-buffer | 26 | (with-temp-buffer |
| 29 | (footnote-mode 1) | 27 | (footnote-mode 1) |
diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index b793f7389b4..2ba00656862 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el | |||
| @@ -598,16 +598,17 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 598 | ;; Define some mode-local overloadable/overridden functions for xref to find | 598 | ;; Define some mode-local overloadable/overridden functions for xref to find |
| 599 | (require 'mode-local) | 599 | (require 'mode-local) |
| 600 | 600 | ||
| 601 | (declare-function xref-elisp-overloadable-no-methods-default "elisp-mode-tests") | ||
| 602 | (declare-function xref-elisp-overloadable-no-default-default "elisp-mode-tests") | ||
| 603 | |||
| 601 | (define-overloadable-function xref-elisp-overloadable-no-methods () | 604 | (define-overloadable-function xref-elisp-overloadable-no-methods () |
| 602 | "doc string overloadable no-methods") | 605 | "doc string overloadable no-methods") |
| 603 | 606 | ||
| 604 | (define-overloadable-function xref-elisp-overloadable-no-default () | 607 | (define-overloadable-function xref-elisp-overloadable-no-default () |
| 605 | "doc string overloadable no-default") | 608 | "doc string overloadable no-default") |
| 606 | 609 | ||
| 607 | ;; FIXME: byte compiler complains about unused lexical arguments | ||
| 608 | ;; generated by this macro. | ||
| 609 | (define-mode-local-override xref-elisp-overloadable-no-default c-mode | 610 | (define-mode-local-override xref-elisp-overloadable-no-default c-mode |
| 610 | (start end &optional nonterminal depth returnonerror) | 611 | (_start _end &optional _nonterminal _depth _returnonerror) |
| 611 | "doc string overloadable no-default c-mode." | 612 | "doc string overloadable no-default c-mode." |
| 612 | "result overloadable no-default c-mode.") | 613 | "result overloadable no-default c-mode.") |
| 613 | 614 | ||
| @@ -616,7 +617,7 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 616 | "result overloadable co-located-default.") | 617 | "result overloadable co-located-default.") |
| 617 | 618 | ||
| 618 | (define-mode-local-override xref-elisp-overloadable-co-located-default c-mode | 619 | (define-mode-local-override xref-elisp-overloadable-co-located-default c-mode |
| 619 | (start end &optional nonterminal depth returnonerror) | 620 | (_start _end &optional _nonterminal _depth _returnonerror) |
| 620 | "doc string overloadable co-located-default c-mode." | 621 | "doc string overloadable co-located-default c-mode." |
| 621 | "result overloadable co-located-default c-mode.") | 622 | "result overloadable co-located-default c-mode.") |
| 622 | 623 | ||
| @@ -628,7 +629,7 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 628 | "result overloadable separate-default.") | 629 | "result overloadable separate-default.") |
| 629 | 630 | ||
| 630 | (define-mode-local-override xref-elisp-overloadable-separate-default c-mode | 631 | (define-mode-local-override xref-elisp-overloadable-separate-default c-mode |
| 631 | (start end &optional nonterminal depth returnonerror) | 632 | (_start _end &optional _nonterminal _depth _returnonerror) |
| 632 | "doc string overloadable separate-default c-mode." | 633 | "doc string overloadable separate-default c-mode." |
| 633 | "result overloadable separate-default c-mode.") | 634 | "result overloadable separate-default c-mode.") |
| 634 | 635 | ||
diff --git a/test/lisp/progmodes/sql-tests.el b/test/lisp/progmodes/sql-tests.el index d6f89341bed..65ed76bfb5d 100644 --- a/test/lisp/progmodes/sql-tests.el +++ b/test/lisp/progmodes/sql-tests.el | |||
| @@ -193,7 +193,7 @@ Perform ACTION and validate results" | |||
| 193 | "Add a product that already exists." | 193 | "Add a product that already exists." |
| 194 | 194 | ||
| 195 | (sql-test-product-feature-harness | 195 | (sql-test-product-feature-harness |
| 196 | (should-error (sql-add-feature 'a "Aaa")) | 196 | (should-error (sql-add-product 'a "Aaa")) |
| 197 | (should (equal (pp-to-string (assoc 'a sql-product-alist)) | 197 | (should (equal (pp-to-string (assoc 'a sql-product-alist)) |
| 198 | "(a :X 1 :Y 2 :Z sql-test-feature-value-a)\n")))) | 198 | "(a :X 1 :Y 2 :Z sql-test-feature-value-a)\n")))) |
| 199 | 199 | ||
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index 03f7260f551..c8b913b3f1c 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el | |||
| @@ -716,8 +716,7 @@ See Bug#21722." | |||
| 716 | 716 | ||
| 717 | (defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body) | 717 | (defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body) |
| 718 | (declare (debug (sexp form body)) (indent 2)) | 718 | (declare (debug (sexp form body)) (indent 2)) |
| 719 | (let ((expected (make-symbol "expected")) | 719 | (let ((command (make-symbol "command")) |
| 720 | (command (make-symbol "command")) | ||
| 721 | (caller-buf (make-symbol "caller-buf")) | 720 | (caller-buf (make-symbol "caller-buf")) |
| 722 | (output-buf (make-symbol "output-buf"))) | 721 | (output-buf (make-symbol "output-buf"))) |
| 723 | `(let* ((,caller-buf (generate-new-buffer "caller-buf")) | 722 | `(let* ((,caller-buf (generate-new-buffer "caller-buf")) |
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index baa547758ef..5b01c54cf24 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el | |||
| @@ -129,6 +129,8 @@ wdired-mode." | |||
| 129 | (delete-directory test-dir t))))) | 129 | (delete-directory test-dir t))))) |
| 130 | 130 | ||
| 131 | (defvar server-socket-dir) | 131 | (defvar server-socket-dir) |
| 132 | (declare-function dired-smart-shell-command "dired-x" | ||
| 133 | (command &optional output-buffer error-buffer)) | ||
| 132 | 134 | ||
| 133 | (ert-deftest wdired-test-bug34915 () | 135 | (ert-deftest wdired-test-bug34915 () |
| 134 | "Test editing when dired-listing-switches includes -F. | 136 | "Test editing when dired-listing-switches includes -F. |
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 1c356698f66..60d29dd3a12 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | ;;; Code: | 20 | ;;; Code: |
| 21 | 21 | ||
| 22 | (require 'ert) | 22 | (require 'ert) |
| 23 | (require 'seq) | ||
| 23 | (eval-when-compile (require 'cl-lib)) | 24 | (eval-when-compile (require 'cl-lib)) |
| 24 | 25 | ||
| 25 | (ert-deftest overlay-modification-hooks-message-other-buf () | 26 | (ert-deftest overlay-modification-hooks-message-other-buf () |
diff --git a/test/src/data-tests.el b/test/src/data-tests.el index 3cebb3dfa57..ed092039078 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el | |||
| @@ -174,7 +174,7 @@ most-positive-fixnum, which is just less than a power of 2.") | |||
| 174 | sum 1)) | 174 | sum 1)) |
| 175 | 175 | ||
| 176 | (defun test-bool-vector-bv-from-hex-string (desc) | 176 | (defun test-bool-vector-bv-from-hex-string (desc) |
| 177 | (let (bv nchars nibbles) | 177 | (let (bv nibbles) |
| 178 | (dolist (c (string-to-list desc)) | 178 | (dolist (c (string-to-list desc)) |
| 179 | (push (string-to-number | 179 | (push (string-to-number |
| 180 | (char-to-string c) | 180 | (char-to-string c) |
| @@ -244,9 +244,9 @@ comparing the subr with a much slower lisp implementation." | |||
| 244 | 244 | ||
| 245 | (defun test-bool-vector-apply-mock-op (mock a b c) | 245 | (defun test-bool-vector-apply-mock-op (mock a b c) |
| 246 | "Compute (slowly) the correct result of a bool-vector set operation." | 246 | "Compute (slowly) the correct result of a bool-vector set operation." |
| 247 | (let (changed nv) | 247 | (let (changed) |
| 248 | (cl-assert (eql (length b) (length c))) | 248 | (cl-assert (eql (length b) (length c))) |
| 249 | (if a (setf nv a) | 249 | (unless a |
| 250 | (setf a (make-bool-vector (length b) nil)) | 250 | (setf a (make-bool-vector (length b) nil)) |
| 251 | (setf changed t)) | 251 | (setf changed t)) |
| 252 | 252 | ||