aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrea Corallo2021-03-19 15:28:00 +0100
committerAndrea Corallo2021-03-19 15:28:00 +0100
commit6ca6c71cd0bf8fc970d9b1477ea61a670469f672 (patch)
tree98876b3f80794a8aad43293fbe005102e26e94f9 /test
parentb3ad62f8a35617366886be2a86e8641282824adf (diff)
parent3af2cee64b86e4ce59adb8e8720d92db35039cbc (diff)
downloademacs-6ca6c71cd0bf8fc970d9b1477ea61a670469f672.tar.gz
emacs-6ca6c71cd0bf8fc970d9b1477ea61a670469f672.zip
Merge remote-tracking branch 'savannah/master' into native-comp
Diffstat (limited to 'test')
-rw-r--r--test/README6
-rw-r--r--test/lisp/cedet/semantic-utest.el2
-rw-r--r--test/lisp/cedet/semantic/bovine/gcc-tests.el2
-rw-r--r--test/lisp/cedet/semantic/format-resources/test-fmt.el2
-rw-r--r--test/lisp/cedet/semantic/format-tests.el2
-rw-r--r--test/lisp/cedet/semantic/fw-tests.el2
-rw-r--r--test/lisp/comint-tests.el1
-rw-r--r--test/lisp/emacs-lisp/cl-macs-tests.el25
-rw-r--r--test/lisp/image-tests.el15
-rw-r--r--test/lisp/net/tramp-tests.el4
-rw-r--r--test/lisp/progmodes/cperl-mode-tests.el31
-rw-r--r--test/lisp/simple-tests.el9
-rw-r--r--test/manual/cedet/semantic-tests.el2
-rw-r--r--test/src/undo-tests.el2
14 files changed, 89 insertions, 16 deletions
diff --git a/test/README b/test/README
index 1e0e43a8aca..a348074aba7 100644
--- a/test/README
+++ b/test/README
@@ -22,7 +22,10 @@ following tags are recognized:
22* :unstable 22* :unstable
23 The test is under development. It shall run on demand only. 23 The test is under development. It shall run on demand only.
24 24
25The Makefile in this directory supports the following targets: 25The Makefile sets the environment variable $EMACS_TEST_DIRECTORY,
26which points to this directory. This environment variable does not
27exist when the tests are run outside make. The Makefile supports the
28following targets:
26 29
27* make check 30* make check
28 Run all tests as defined in the directory. Expensive and unstable 31 Run all tests as defined in the directory. Expensive and unstable
@@ -113,6 +116,7 @@ Some optional tests require packages from GNU ELPA. By default
113out somewhere else, use 116out somewhere else, use
114 117
115 make GNU_ELPA_DIRECTORY=/path/to/elpa ... 118 make GNU_ELPA_DIRECTORY=/path/to/elpa ...
119
116 120
117There are also continuous integration tests on 121There are also continuous integration tests on
118<https://hydra.nixos.org/jobset/gnu/emacs-trunk> (see 122<https://hydra.nixos.org/jobset/gnu/emacs-trunk> (see
diff --git a/test/lisp/cedet/semantic-utest.el b/test/lisp/cedet/semantic-utest.el
index 67de4a5b02d..172ab62f895 100644
--- a/test/lisp/cedet/semantic-utest.el
+++ b/test/lisp/cedet/semantic-utest.el
@@ -1,6 +1,6 @@
1;;; semantic-utest.el --- Tests for semantic's parsing system. -*- lexical-binding:t -*- 1;;; semantic-utest.el --- Tests for semantic's parsing system. -*- lexical-binding:t -*-
2 2
3;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
4 4
5;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6 6
diff --git a/test/lisp/cedet/semantic/bovine/gcc-tests.el b/test/lisp/cedet/semantic/bovine/gcc-tests.el
index e1a18c6c64c..93677d6c871 100644
--- a/test/lisp/cedet/semantic/bovine/gcc-tests.el
+++ b/test/lisp/cedet/semantic/bovine/gcc-tests.el
@@ -1,6 +1,6 @@
1;;; gcc-tests.el --- Tests for semantic/bovine/gcc.el -*- lexical-binding:t -*- 1;;; gcc-tests.el --- Tests for semantic/bovine/gcc.el -*- lexical-binding:t -*-
2 2
3;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
4 4
5;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6 6
diff --git a/test/lisp/cedet/semantic/format-resources/test-fmt.el b/test/lisp/cedet/semantic/format-resources/test-fmt.el
index 941aaae8595..8458a8e6510 100644
--- a/test/lisp/cedet/semantic/format-resources/test-fmt.el
+++ b/test/lisp/cedet/semantic/format-resources/test-fmt.el
@@ -1,6 +1,6 @@
1;;; test-fmt.el --- test semantic tag formatting -*- lexical-binding: t -*- 1;;; test-fmt.el --- test semantic tag formatting -*- lexical-binding: t -*-
2 2
3;;; Copyright (C) 2012, 2019-2021 Free Software Foundation, Inc. 3;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
4 4
5;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6 6
diff --git a/test/lisp/cedet/semantic/format-tests.el b/test/lisp/cedet/semantic/format-tests.el
index e82c97b4c43..149f408af15 100644
--- a/test/lisp/cedet/semantic/format-tests.el
+++ b/test/lisp/cedet/semantic/format-tests.el
@@ -1,6 +1,6 @@
1;;; semantic/format-tests.el --- Parsing / Formatting tests -*- lexical-binding:t -*- 1;;; semantic/format-tests.el --- Parsing / Formatting tests -*- lexical-binding:t -*-
2 2
3;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
4 4
5;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6 6
diff --git a/test/lisp/cedet/semantic/fw-tests.el b/test/lisp/cedet/semantic/fw-tests.el
index 62d665dbb6e..7b1cd21bd1b 100644
--- a/test/lisp/cedet/semantic/fw-tests.el
+++ b/test/lisp/cedet/semantic/fw-tests.el
@@ -1,6 +1,6 @@
1;;; fw-tests.el --- Tests for semantic/fw.el -*- lexical-binding:t -*- 1;;; fw-tests.el --- Tests for semantic/fw.el -*- lexical-binding:t -*-
2 2
3;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
4 4
5;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6 6
diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el
index de1bc548e18..8a9a41f452f 100644
--- a/test/lisp/comint-tests.el
+++ b/test/lisp/comint-tests.el
@@ -44,6 +44,7 @@
44 "Password (again):" 44 "Password (again):"
45 "Enter password:" 45 "Enter password:"
46 "Enter Auth Password:" ; OpenVPN (Bug#35724) 46 "Enter Auth Password:" ; OpenVPN (Bug#35724)
47 "Verify password: " ; zip -e zipfile.zip ... (Bug#47209)
47 "Mot de Passe :" ; localized (Bug#29729) 48 "Mot de Passe :" ; localized (Bug#29729)
48 "Passwort:") ; localized 49 "Passwort:") ; localized
49 "List of strings that should match `comint-password-prompt-regexp'.") 50 "List of strings that should match `comint-password-prompt-regexp'.")
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el
index 2e5f3020b41..df1d26a074e 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -617,11 +617,26 @@ collection clause."
617 (cl-labels ((len (xs) (if xs (1+ (len (cdr xs))) 0))) 617 (cl-labels ((len (xs) (if xs (1+ (len (cdr xs))) 0)))
618 (should (equal (len (make-list 42 t)) 42))) 618 (should (equal (len (make-list 42 t)) 42)))
619 619
620 ;; Simple tail-recursive function. 620 (let ((list-42 (make-list 42 t))
621 (cl-labels ((len (xs n) (if xs (len (cdr xs) (1+ n)) n))) 621 (list-42k (make-list 42000 t)))
622 (should (equal (len (make-list 42 t) 0) 42)) 622
623 ;; Should not bump into stack depth limits. 623 (cl-labels
624 (should (equal (len (make-list 42000 t) 0) 42000))) 624 ;; Simple tail-recursive function.
625 ((len (xs n) (if xs (len (cdr xs) (1+ n)) n))
626 ;; Slightly obfuscated version to exercise tail calls from
627 ;; `let', `progn', `and' and `or'.
628 (len2 (xs n) (or (and (not xs) n)
629 (let (n1)
630 (and xs
631 (progn (setq n1 (1+ n))
632 (len2 (cdr xs) n1)))))))
633 (should (equal (len nil 0) 0))
634 (should (equal (len2 nil 0) 0))
635 (should (equal (len list-42 0) 42))
636 (should (equal (len2 list-42 0) 42))
637 ;; Should not bump into stack depth limits.
638 (should (equal (len list-42k 0) 42000))
639 (should (equal (len2 list-42k 0) 42000))))
625 640
626 ;; Check that non-recursive functions are handled more efficiently. 641 ;; Check that non-recursive functions are handled more efficiently.
627 (should (pcase (macroexpand '(cl-labels ((f (x) (+ x 1))) (f 5))) 642 (should (pcase (macroexpand '(cl-labels ((f (x) (+ x 1))) (f 5)))
diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index ab7585ca050..2f7afa2f38e 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -25,7 +25,7 @@
25 (require 'cl-lib)) 25 (require 'cl-lib))
26 26
27(defconst image-tests--emacs-images-directory 27(defconst image-tests--emacs-images-directory
28 (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY")) 28 (expand-file-name "images" data-directory)
29 "Directory containing Emacs images.") 29 "Directory containing Emacs images.")
30 30
31(ert-deftest image--set-property () 31(ert-deftest image--set-property ()
@@ -48,6 +48,19 @@
48 (setf (image-property image :width) nil) 48 (setf (image-property image :width) nil)
49 (should (equal image '(image))))) 49 (should (equal image '(image)))))
50 50
51(ert-deftest image-find-image ()
52 (find-image '((:type xpm :file "undo.xpm")))
53 (find-image '((:type png :file "newsticker/rss-feed.png" :ascent center))))
54
55(ert-deftest image-type-from-file-name ()
56 (should (eq (image-type-from-file-name "foo.jpg") 'jpeg))
57 (should (eq (image-type-from-file-name "foo.png") 'png)))
58
59(ert-deftest image-type/from-filename ()
60 ;; On emba, `image-load-path' does not exist.
61 (skip-unless (bound-and-true-p image-load-path))
62 (should (eq (image-type "foo.jpg") 'jpeg)))
63
51(ert-deftest image-type-from-file-header-test () 64(ert-deftest image-type-from-file-header-test ()
52 "Test image-type-from-file-header." 65 "Test image-type-from-file-header."
53 (should (eq (if (image-type-available-p 'svg) 'svg) 66 (should (eq (if (image-type-available-p 'svg) 'svg)
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 6565919c771..be428fc2a64 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -6380,7 +6380,7 @@ process sentinels. They shall not disturb each other."
6380 ;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for 6380 ;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for
6381 ;; remote processes in Emacs. That doesn't work for tramp-adb.el. 6381 ;; remote processes in Emacs. That doesn't work for tramp-adb.el.
6382 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p)) 6382 (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p))
6383 (tramp--test-sh-p) (tramp--test-sshfs-p))) 6383 (tramp--test-sh-p)))
6384 (skip-unless (not (tramp--test-crypt-p))) 6384 (skip-unless (not (tramp--test-crypt-p)))
6385 (skip-unless (not (tramp--test-docker-p))) 6385 (skip-unless (not (tramp--test-docker-p)))
6386 (skip-unless (not (tramp--test-windows-nt-p))) 6386 (skip-unless (not (tramp--test-windows-nt-p)))
@@ -6767,6 +6767,8 @@ If INTERACTIVE is non-nil, the tests are run interactively."
6767;; * Fix `tramp-test06-directory-file-name' for `ftp'. 6767;; * Fix `tramp-test06-directory-file-name' for `ftp'.
6768;; * Implement `tramp-test31-interrupt-process' for `adb', `sshfs' and 6768;; * Implement `tramp-test31-interrupt-process' for `adb', `sshfs' and
6769;; for direct async processes. 6769;; for direct async processes.
6770;; * Check, why direct async processes do not work for
6771;; `tramp-test43-asynchronous-requests'.
6770 6772
6771(provide 'tramp-tests) 6773(provide 'tramp-tests)
6772 6774
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
index 61e4ece49b7..8078e9c9fa9 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -135,6 +135,9 @@ point in the distant past, and is still broken in perl-mode. "
135 (should (equal (nth 3 (syntax-ppss)) nil)) 135 (should (equal (nth 3 (syntax-ppss)) nil))
136 (should (equal (nth 4 (syntax-ppss)) t)))))) 136 (should (equal (nth 4 (syntax-ppss)) t))))))
137 137
138(defvar perl-continued-statement-offset)
139(defvar perl-indent-level)
140
138(ert-deftest cperl-test-heredocs () 141(ert-deftest cperl-test-heredocs ()
139 "Test that HERE-docs are fontified with the appropriate face." 142 "Test that HERE-docs are fontified with the appropriate face."
140 (require 'perl-mode) 143 (require 'perl-mode)
@@ -242,7 +245,7 @@ This test relies on the specific layout of the index alist as
242created by CPerl mode, so skip it for Perl mode." 245created by CPerl mode, so skip it for Perl mode."
243 (skip-unless (eq cperl-test-mode #'cperl-mode)) 246 (skip-unless (eq cperl-test-mode #'cperl-mode))
244 (with-temp-buffer 247 (with-temp-buffer
245 (insert-file (ert-resource-file "grammar.pl")) 248 (insert-file-contents (ert-resource-file "grammar.pl"))
246 (cperl-mode) 249 (cperl-mode)
247 (let ((index (cperl-imenu--create-perl-index)) 250 (let ((index (cperl-imenu--create-perl-index))
248 current-list) 251 current-list)
@@ -447,4 +450,30 @@ have a face property."
447 ;; The yadda-yadda operator should not be in a string. 450 ;; The yadda-yadda operator should not be in a string.
448 (should (equal (nth 8 (cperl-test-ppss code "\\.")) nil)))) 451 (should (equal (nth 8 (cperl-test-ppss code "\\.")) nil))))
449 452
453(ert-deftest cperl-test-bug-47112 ()
454 "Check that in a bareword starting with a quote-like operator
455followed by an underscore is not interpreted as that quote-like
456operator. Also check that a quote-like operator followed by a
457colon (which is, like ?_, a symbol in CPerl mode) _is_ identified
458as that quote like operator."
459 (with-temp-buffer
460 (funcall cperl-test-mode)
461 (insert "sub y_max { q:bar:; y _bar_foo_; }")
462 (goto-char (point-min))
463 (syntax-propertize (point-max))
464 (font-lock-ensure)
465 (search-forward "max")
466 (should (equal (get-text-property (match-beginning 0) 'face)
467 'font-lock-function-name-face))
468 (search-forward "bar")
469 (should (equal (get-text-property (match-beginning 0) 'face)
470 'font-lock-string-face))
471 ; perl-mode doesn't highlight
472 (when (eq cperl-test-mode #'cperl-mode)
473 (search-forward "_")
474 (should (equal (get-text-property (match-beginning 0) 'face)
475 (if (eq cperl-test-mode #'cperl-mode)
476 'font-lock-constant-face
477 font-lock-string-face))))))
478
450;;; cperl-mode-tests.el ends here 479;;; cperl-mode-tests.el ends here
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 1819775bda5..601eca6cd49 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -465,9 +465,15 @@ See bug#35036."
465 (simple-tests--exec '(backward-char undo-redo undo-redo)) 465 (simple-tests--exec '(backward-char undo-redo undo-redo))
466 (should (equal (buffer-string) "abc")) 466 (should (equal (buffer-string) "abc"))
467 (simple-tests--exec '(backward-char undo-redo undo-redo)) 467 (simple-tests--exec '(backward-char undo-redo undo-redo))
468 (should (equal (buffer-string) "abcde"))) 468 (should (equal (buffer-string) "abcde"))))
469
470(ert-deftest simple-tests--undo-in-region ()
469 ;; Test undo/redo in region. 471 ;; Test undo/redo in region.
470 (with-temp-buffer 472 (with-temp-buffer
473 ;; Enable `transient-mark-mode' so `region-active-p' works as
474 ;; expected. `region-active-p' is used to determine whether to
475 ;; perform regional undo in `undo'.
476 (transient-mark-mode)
471 (buffer-enable-undo) 477 (buffer-enable-undo)
472 (dolist (x '("a" "b" "c" "d" "e")) 478 (dolist (x '("a" "b" "c" "d" "e"))
473 (insert x) 479 (insert x)
@@ -505,6 +511,7 @@ See bug#35036."
505(ert-deftest simple-tests--undo-equiv-table () 511(ert-deftest simple-tests--undo-equiv-table ()
506 (with-temp-buffer 512 (with-temp-buffer
507 (buffer-enable-undo) 513 (buffer-enable-undo)
514 (transient-mark-mode)
508 (let ((ul-hash-table (make-hash-table :test #'equal))) 515 (let ((ul-hash-table (make-hash-table :test #'equal)))
509 (dolist (x '("a" "b" "c")) 516 (dolist (x '("a" "b" "c"))
510 (insert x) 517 (insert x)
diff --git a/test/manual/cedet/semantic-tests.el b/test/manual/cedet/semantic-tests.el
index 61f1d118fd2..7169c78bea0 100644
--- a/test/manual/cedet/semantic-tests.el
+++ b/test/manual/cedet/semantic-tests.el
@@ -1,6 +1,6 @@
1;;; semantic-utest.el --- Miscellaneous Semantic tests. -*- lexical-binding: t; -*- 1;;; semantic-utest.el --- Miscellaneous Semantic tests. -*- lexical-binding: t; -*-
2 2
3;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
4 4
5;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6 6
diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el
index 055bf102dfc..a658bccf6dc 100644
--- a/test/src/undo-tests.el
+++ b/test/src/undo-tests.el
@@ -46,6 +46,7 @@
46;;; Code: 46;;; Code:
47 47
48(require 'ert) 48(require 'ert)
49(require 'facemenu)
49 50
50(ert-deftest undo-test0 () 51(ert-deftest undo-test0 ()
51 "Test basics of \\[undo]." 52 "Test basics of \\[undo]."
@@ -87,6 +88,7 @@
87 88
88(ert-deftest undo-test1 () 89(ert-deftest undo-test1 ()
89 "Test undo of \\[undo] command (redo)." 90 "Test undo of \\[undo] command (redo)."
91 (require 'facemenu)
90 (with-temp-buffer 92 (with-temp-buffer
91 (buffer-enable-undo) 93 (buffer-enable-undo)
92 (undo-boundary) 94 (undo-boundary)