diff options
| author | Stephen Leake | 2018-12-13 14:39:02 -0800 |
|---|---|---|
| committer | Stephen Leake | 2018-12-13 14:39:02 -0800 |
| commit | 87bef630bf0f45e8da74e43ba614aa2292b296ef (patch) | |
| tree | efdead3c0d7dd227bacbd4dfc5c1ff9b4d5c13c3 /test | |
| parent | 4d3f7b77cc7dea072d2ecb9f137c2e497bc52da1 (diff) | |
| parent | d08b75abe0f0cf9ade812b189c374809a2c7836e (diff) | |
| download | emacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.tar.gz emacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.zip | |
Merge commit 'd08b75abe0f0cf9ade812b189c374809a2c7836e'
Diffstat (limited to 'test')
| -rw-r--r-- | test/Makefile.in | 8 | ||||
| -rw-r--r-- | test/lisp/eshell/em-ls-tests.el | 14 | ||||
| -rw-r--r-- | test/lisp/net/secrets-tests.el | 7 | ||||
| -rw-r--r-- | test/lisp/progmodes/ruby-mode-tests.el | 90 | ||||
| -rw-r--r-- | test/src/fileio-tests.el | 4 |
5 files changed, 116 insertions, 7 deletions
diff --git a/test/Makefile.in b/test/Makefile.in index adb316c3d9c..4548323f26a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in | |||
| @@ -190,6 +190,12 @@ else | |||
| 190 | maybe_exclude_module_tests := -name emacs-module-tests.el -prune -o | 190 | maybe_exclude_module_tests := -name emacs-module-tests.el -prune -o |
| 191 | endif | 191 | endif |
| 192 | 192 | ||
| 193 | ## Optional list of .el files to exclude from testing. | ||
| 194 | ## Intended for use in automated testing where one or more files | ||
| 195 | ## has some problem and needs to be excluded. | ||
| 196 | ## To avoid writing full name, can use eg %foo-tests.el. | ||
| 197 | EXCLUDE_TESTS = | ||
| 198 | |||
| 193 | ## To speed up parallel builds, put these slow test files (which can | 199 | ## To speed up parallel builds, put these slow test files (which can |
| 194 | ## take longer than all the rest combined) at the start of the list. | 200 | ## take longer than all the rest combined) at the start of the list. |
| 195 | SLOW_TESTS = ${srcdir}/lisp/net/tramp-tests.el | 201 | SLOW_TESTS = ${srcdir}/lisp/net/tramp-tests.el |
| @@ -202,6 +208,8 @@ ELFILES := $(sort $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \ | |||
| 202 | 208 | ||
| 203 | $(foreach slow,${SLOW_TESTS},$(eval ELFILES:= ${slow} $(filter-out ${slow},${ELFILES}))) | 209 | $(foreach slow,${SLOW_TESTS},$(eval ELFILES:= ${slow} $(filter-out ${slow},${ELFILES}))) |
| 204 | 210 | ||
| 211 | $(foreach exclude,${EXCLUDE_TESTS},$(eval ELFILES:= $(filter-out ${exclude},${ELFILES}))) | ||
| 212 | |||
| 205 | ## .log files may be in a different directory for out of source builds | 213 | ## .log files may be in a different directory for out of source builds |
| 206 | LOGFILES := $(patsubst %.el,%.log, \ | 214 | LOGFILES := $(patsubst %.el,%.log, \ |
| 207 | $(patsubst $(srcdir)/%,%,$(ELFILES))) | 215 | $(patsubst $(srcdir)/%,%,$(ELFILES))) |
diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el index c5c9eac3249..b89a54641bd 100644 --- a/test/lisp/eshell/em-ls-tests.el +++ b/test/lisp/eshell/em-ls-tests.el | |||
| @@ -78,6 +78,11 @@ | |||
| 78 | 78 | ||
| 79 | (ert-deftest em-ls-test-bug27844 () | 79 | (ert-deftest em-ls-test-bug27844 () |
| 80 | "Test for https://debbugs.gnu.org/27844 ." | 80 | "Test for https://debbugs.gnu.org/27844 ." |
| 81 | ;; FIXME: it would be better to use something other than source-directory | ||
| 82 | ;; in this test. | ||
| 83 | (skip-unless (and source-directory | ||
| 84 | (file-exists-p | ||
| 85 | (expand-file-name "lisp/subr.el" source-directory)))) | ||
| 81 | (let ((orig eshell-ls-use-in-dired) | 86 | (let ((orig eshell-ls-use-in-dired) |
| 82 | (dired-use-ls-dired 'unspecified) | 87 | (dired-use-ls-dired 'unspecified) |
| 83 | buf insert-directory-program) | 88 | buf insert-directory-program) |
| @@ -89,6 +94,15 @@ | |||
| 89 | (should (cdr (dired-get-marked-files))) | 94 | (should (cdr (dired-get-marked-files))) |
| 90 | (kill-buffer buf) | 95 | (kill-buffer buf) |
| 91 | (setq buf (dired (expand-file-name "lisp/subr.el" source-directory))) | 96 | (setq buf (dired (expand-file-name "lisp/subr.el" source-directory))) |
| 97 | (when (getenv "EMACS_HYDRA_CI") | ||
| 98 | (message "X1%s" (buffer-substring-no-properties | ||
| 99 | (point-min) (point-max))) | ||
| 100 | (message "X2%s" (buffer-substring-no-properties | ||
| 101 | (line-beginning-position) | ||
| 102 | (line-end-position))) | ||
| 103 | (message "X3%s" (buffer-substring-no-properties | ||
| 104 | (point) | ||
| 105 | (line-end-position)))) | ||
| 92 | (should (looking-at "subr\\.el"))) | 106 | (should (looking-at "subr\\.el"))) |
| 93 | (customize-set-variable 'eshell-ls-use-in-dired orig) | 107 | (customize-set-variable 'eshell-ls-use-in-dired orig) |
| 94 | (and (buffer-live-p buf) (kill-buffer))))) | 108 | (and (buffer-live-p buf) (kill-buffer))))) |
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el index de3ce731bec..d34b0021952 100644 --- a/test/lisp/net/secrets-tests.el +++ b/test/lisp/net/secrets-tests.el | |||
| @@ -90,10 +90,6 @@ | |||
| 90 | (unwind-protect | 90 | (unwind-protect |
| 91 | (progn | 91 | (progn |
| 92 | (should (secrets-open-session)) | 92 | (should (secrets-open-session)) |
| 93 | |||
| 94 | ;; There must be at least the collections "Login" and "session". | ||
| 95 | (should (or (member "Login" (secrets-list-collections)) | ||
| 96 | (member "login" (secrets-list-collections)))) | ||
| 97 | (should (member "session" (secrets-list-collections))) | 93 | (should (member "session" (secrets-list-collections))) |
| 98 | 94 | ||
| 99 | ;; Create a random collection. This asks for a password | 95 | ;; Create a random collection. This asks for a password |
| @@ -160,9 +156,6 @@ | |||
| 160 | 156 | ||
| 161 | ;; There shall be no items in the "session" collection. | 157 | ;; There shall be no items in the "session" collection. |
| 162 | (should-not (secrets-list-items "session")) | 158 | (should-not (secrets-list-items "session")) |
| 163 | ;; There shall be items in the "Login" collection. | ||
| 164 | (should (or (secrets-list-items "Login") | ||
| 165 | (secrets-list-items "login"))) | ||
| 166 | 159 | ||
| 167 | ;; Create a new item. | 160 | ;; Create a new item. |
| 168 | (should (setq item-path (secrets-create-item "session" "foo" "secret"))) | 161 | (should (setq item-path (secrets-create-item "session" "foo" "secret"))) |
diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 72d83affaef..afd6d65c9d1 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el | |||
| @@ -718,6 +718,96 @@ VALUES-PLIST is a list with alternating index and value elements." | |||
| 718 | (ruby-backward-sexp) | 718 | (ruby-backward-sexp) |
| 719 | (should (= 2 (line-number-at-pos))))) | 719 | (should (= 2 (line-number-at-pos))))) |
| 720 | 720 | ||
| 721 | (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-no-args () | ||
| 722 | (ruby-with-temp-buffer | ||
| 723 | (ruby-test-string | ||
| 724 | "proc do | ||
| 725 | |end") | ||
| 726 | (search-backward "do\n") | ||
| 727 | (ruby-forward-sexp) | ||
| 728 | (should (eobp)))) | ||
| 729 | |||
| 730 | (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-no-args () | ||
| 731 | (ruby-with-temp-buffer | ||
| 732 | (ruby-test-string | ||
| 733 | "proc do | ||
| 734 | |end") | ||
| 735 | (goto-char (point-max)) | ||
| 736 | (ruby-backward-sexp) | ||
| 737 | (should (looking-at "do$")))) | ||
| 738 | |||
| 739 | (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-empty-args () | ||
| 740 | (ruby-with-temp-buffer | ||
| 741 | (ruby-test-string | ||
| 742 | "proc do || | ||
| 743 | |end") | ||
| 744 | (search-backward "do ") | ||
| 745 | (ruby-forward-sexp) | ||
| 746 | (should (eobp)))) | ||
| 747 | |||
| 748 | (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-empty-args () | ||
| 749 | (ruby-with-temp-buffer | ||
| 750 | (ruby-test-string | ||
| 751 | "proc do || | ||
| 752 | |end") | ||
| 753 | (goto-char (point-max)) | ||
| 754 | (ruby-backward-sexp) | ||
| 755 | (should (looking-at "do ")))) | ||
| 756 | |||
| 757 | (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-args () | ||
| 758 | (ruby-with-temp-buffer | ||
| 759 | (ruby-test-string | ||
| 760 | "proc do |a,b| | ||
| 761 | |end") | ||
| 762 | (search-backward "do ") | ||
| 763 | (ruby-forward-sexp) | ||
| 764 | (should (eobp)))) | ||
| 765 | |||
| 766 | (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-args () | ||
| 767 | (ruby-with-temp-buffer | ||
| 768 | (ruby-test-string | ||
| 769 | "proc do |a,b| | ||
| 770 | |end") | ||
| 771 | (goto-char (point-max)) | ||
| 772 | (ruby-backward-sexp) | ||
| 773 | (should (looking-at "do ")))) | ||
| 774 | |||
| 775 | (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-any-args () | ||
| 776 | (ruby-with-temp-buffer | ||
| 777 | (ruby-test-string | ||
| 778 | "proc do |*| | ||
| 779 | |end") | ||
| 780 | (search-backward "do ") | ||
| 781 | (ruby-forward-sexp) | ||
| 782 | (should (eobp)))) | ||
| 783 | |||
| 784 | (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg () | ||
| 785 | (ruby-with-temp-buffer | ||
| 786 | (ruby-test-string | ||
| 787 | "proc do |a,| | ||
| 788 | |end") | ||
| 789 | (search-backward "do ") | ||
| 790 | (ruby-forward-sexp) | ||
| 791 | (should (eobp)))) | ||
| 792 | |||
| 793 | (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args () | ||
| 794 | (ruby-with-temp-buffer | ||
| 795 | (ruby-test-string | ||
| 796 | "proc do |a,*| | ||
| 797 | |end") | ||
| 798 | (search-backward "do ") | ||
| 799 | (ruby-forward-sexp) | ||
| 800 | (should (eobp)))) | ||
| 801 | |||
| 802 | (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args () | ||
| 803 | (ruby-with-temp-buffer | ||
| 804 | (ruby-test-string | ||
| 805 | "proc do |a,*| | ||
| 806 | |end") | ||
| 807 | (goto-char (point-max)) | ||
| 808 | (ruby-backward-sexp) | ||
| 809 | (should (looking-at "do ")))) | ||
| 810 | |||
| 721 | (ert-deftest ruby-toggle-string-quotes-quotes-correctly () | 811 | (ert-deftest ruby-toggle-string-quotes-quotes-correctly () |
| 722 | (let ((pairs | 812 | (let ((pairs |
| 723 | '(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"") | 813 | '(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"") |
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index b7b78bbda09..a74bcea41f2 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el | |||
| @@ -102,4 +102,8 @@ Also check that an encoding error can appear in a symlink." | |||
| 102 | (setenv "HOME" "a/b/c") | 102 | (setenv "HOME" "a/b/c") |
| 103 | (should (equal (expand-file-name "~/foo") | 103 | (should (equal (expand-file-name "~/foo") |
| 104 | (expand-file-name "a/b/c/foo"))) | 104 | (expand-file-name "a/b/c/foo"))) |
| 105 | (when (memq system-type '(ms-dos windows-nt)) | ||
| 106 | ;; Test expansion of drive-relative file names. | ||
| 107 | (setenv "HOME" "x:foo") | ||
| 108 | (should (equal (expand-file-name "~/bar") "x:/foo/bar"))) | ||
| 105 | (setenv "HOME" old-home))) | 109 | (setenv "HOME" old-home))) |