summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-12-27 17:54:57 +0100
committerAndrea Corallo <akrl@sdf.org>2020-12-27 17:54:57 +0100
commit8fb94630136700aa4e74c7fc212b019d2db380ae (patch)
tree69b3938a89f450509a7001f45ba3acca057fb40d /test/lisp
parent271fb8a269aff924070b188f23355d0c368356dd (diff)
parentdf882c9701755e2ae063f05d3381de14ae09951e (diff)
downloademacs-8fb94630136700aa4e74c7fc212b019d2db380ae.tar.gz
emacs-8fb94630136700aa4e74c7fc212b019d2db380ae.tar.bz2
emacs-8fb94630136700aa4e74c7fc212b019d2db380ae.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/cedet/semantic-utest-ia.el2
-rw-r--r--test/lisp/emacs-lisp/find-func-tests.el10
-rw-r--r--test/lisp/emacs-lisp/subr-x-tests.el28
-rw-r--r--test/lisp/gnus/mml-sec-tests.el10
-rw-r--r--test/lisp/net/tramp-tests.el6
5 files changed, 44 insertions, 12 deletions
diff --git a/test/lisp/cedet/semantic-utest-ia.el b/test/lisp/cedet/semantic-utest-ia.el
index c99ef97b509..ea1a7790985 100644
--- a/test/lisp/cedet/semantic-utest-ia.el
+++ b/test/lisp/cedet/semantic-utest-ia.el
@@ -86,6 +86,7 @@
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-nsp.cpp ()
+ (skip-unless (executable-find "g++"))
(let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(should-not (semantic-ia-utest tst))))
@@ -96,6 +97,7 @@
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-namespace.cpp ()
+ (skip-unless (executable-find "g++"))
(let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
(should (file-exists-p tst))
(should-not (semantic-ia-utest tst))))
diff --git a/test/lisp/emacs-lisp/find-func-tests.el b/test/lisp/emacs-lisp/find-func-tests.el
index d77eb6757ff..03df4bb9ff4 100644
--- a/test/lisp/emacs-lisp/find-func-tests.el
+++ b/test/lisp/emacs-lisp/find-func-tests.el
@@ -43,5 +43,15 @@
(concat data-directory (kbd "n x / TAB RET"))
(read-library-name)))))
+;; Avoid a byte-compilation warning that may confuse people reading
+;; the result of the following test.
+(declare-function compilation--message->loc nil "compile")
+
+(ert-deftest find-func-tests--locate-macro-generated-symbols () ;bug#45443
+ (should (cdr (find-function-search-for-symbol
+ #'compilation--message->loc nil "compile")))
+ (should (cdr (find-function-search-for-symbol
+ 'c-mode-hook 'defvar "cc-mode"))))
+
(provide 'find-func-tests)
;;; find-func-tests.el ends here
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el
index 3fc5f1d3ed3..b17185ab0d3 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -600,18 +600,30 @@
(should (equal (string-limit "foo" 0) ""))
(should-error (string-limit "foo" -1)))
+(ert-deftest subr-string-limit-coding ()
+ (should (not (multibyte-string-p (string-limit "foó" 10 nil 'utf-8))))
+ (should (equal (string-limit "foó" 10 nil 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foó" 3 nil 'utf-8) "fo"))
+ (should (equal (string-limit "foó" 4 nil 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foóa" 4 nil 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foóá" 4 nil 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foóa" 4 nil 'iso-8859-1) "fo\363a"))
+ (should (equal (string-limit "foóá" 4 nil 'iso-8859-1) "fo\363\341"))
+ (should (equal (string-limit "foóá" 4 nil 'utf-16) "\376\377\000f"))
+
+ (should (equal (string-limit "foó" 10 t 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foó" 3 t 'utf-8) "o\303\263"))
+ (should (equal (string-limit "foó" 4 t 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foóa" 4 t 'utf-8) "o\303\263a"))
+ (should (equal (string-limit "foóá" 4 t 'utf-8) "\303\263\303\241"))
+ (should (equal (string-limit "foóa" 4 t 'iso-8859-1) "fo\363a"))
+ (should (equal (string-limit "foóá" 4 t 'iso-8859-1) "fo\363\341"))
+ (should (equal (string-limit "foóá" 4 t 'utf-16) "\376\377\000\341")))
+
(ert-deftest subr-string-lines ()
(should (equal (string-lines "foo") '("foo")))
(should (equal (string-lines "foo \nbar") '("foo " "bar"))))
-(ert-deftest subr-string-slice ()
- (should (equal (string-slice "foo-bar" "-") '("foo" "-bar")))
- (should (equal (string-slice "foo-bar-" "-") '("foo" "-bar" "-")))
- (should (equal (string-slice "-foo-bar-" "-") '("-foo" "-bar" "-")))
- (should (equal (string-slice "ooo" "lala") '("ooo")))
- (should (equal (string-slice "foo bar" "\\b") '("foo" " " "bar" "")))
- (should (equal (string-slice "foo bar" "\\b\\|a") '("foo" " " "b" "ar" ""))))
-
(ert-deftest subr-string-pad ()
(should (equal (string-pad "foo" 5) "foo "))
(should (equal (string-pad "foo" 5 ?-) "foo--"))
diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el
index a6002b4d51e..e3a8c81cc65 100644
--- a/test/lisp/gnus/mml-sec-tests.el
+++ b/test/lisp/gnus/mml-sec-tests.el
@@ -432,6 +432,7 @@ In both cases, the first key is customized for signing and encryption."
(ert-deftest mml-secure-select-preferred-keys-4 ()
"Multiple keys can be recorded per recipient or signature."
(skip-unless (test-conf))
+ (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
(mml-secure-test-fixture
(lambda ()
(let ((pcontext (epg-make-context 'OpenPGP))
@@ -590,6 +591,7 @@ In this test, the single matching key is chosen automatically."
"Encrypt message; then decrypt and test for expected result.
In this test, the encryption key needs to fixed among multiple ones."
(skip-unless (test-conf))
+ (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
;; sub@example.org with multiple candidate keys,
;; fixture customizes preferred ones.
(mml-secure-test-key-fixture
@@ -603,6 +605,7 @@ In this test, the encryption key needs to fixed among multiple ones."
"Encrypt message; then decrypt and test for expected result.
In this test, encrypt-to-self variables are set to t."
(skip-unless (test-conf))
+ (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
;; sub@example.org with multiple candidate keys,
;; fixture customizes preferred ones.
(mml-secure-test-key-fixture
@@ -745,6 +748,7 @@ Use sign-with-sender and encrypt-to-self."
(ert-deftest mml-secure-sign-verify-1 ()
"Sign message with sender; then verify and test for expected result."
(skip-unless (test-conf))
+ (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
(mml-secure-test-key-fixture
(lambda ()
(dolist (method (sign-standards) nil)
@@ -880,10 +884,12 @@ So the second decryption fails."
(dolist (pid (list-system-processes))
(let ((atts (process-attributes pid)))
(when (and (equal (cdr (assq 'user atts)) (user-login-name))
- (equal (cdr (assq 'comm atts)) "gpg-agent")
+ (or (equal (cdr (assq 'comm atts)) "gpg-agent")
+ (equal (cdr (assq 'comm atts)) "scdaemon"))
(string-match
(concat "homedir.*"
- (regexp-quote (ert-resource-directory)))
+ (regexp-quote (directory-file-name
+ (ert-resource-directory))))
(cdr (assq 'args atts))))
(call-process "kill" nil nil nil (format "%d" pid))))))
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 9dd98037a0e..c8756627936 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4663,7 +4663,8 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
(ert-deftest tramp-test31-interrupt-process ()
"Check `interrupt-process'."
- :tags '(:expensive-test)
+ :tags (if (getenv "EMACS_EMBA_CI")
+ '(:expensive-test :unstable) '(:expensive-test))
(skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-crypt-p)))
@@ -6254,7 +6255,8 @@ This is needed in timer functions as well as process filters and sentinels."
"Check parallel asynchronous requests.
Such requests could arrive from timers, process filters and
process sentinels. They shall not disturb each other."
- :tags '(:expensive-test)
+ :tags (if (getenv "EMACS_EMBA_CI")
+ '(:expensive-test :unstable) '(:expensive-test))
(skip-unless (tramp--test-enabled))
;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for
;; remote processes in Emacs. That doesn't work for tramp-adb.el.