diff options
| author | João Távora | 2017-11-09 09:34:58 +0000 |
|---|---|---|
| committer | João Távora | 2017-11-09 09:38:11 +0000 |
| commit | 0da08f2f8ef1946978f0974e9e8cdb87fece018c (patch) | |
| tree | c432b0eb028cdf82edca238e6ad5264bb649fc8a | |
| parent | 781f276cc12a204ec7db9ffd30d22a9a18c0fe94 (diff) | |
| download | emacs-0da08f2f8ef1946978f0974e9e8cdb87fece018c.tar.gz emacs-0da08f2f8ef1946978f0974e9e8cdb87fece018c.zip | |
Protect Flymake tests against older Ruby and Perl (bug#29187)
* test/lisp/progmodes/flymake-tests.el (perl-backend): Search
for the error from the bottom.
(ruby-backend): Protect against situation of bug#29187
| -rw-r--r-- | test/lisp/progmodes/flymake-tests.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index c60f9100345..05214e7a927 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el | |||
| @@ -114,17 +114,24 @@ SEVERITY-PREDICATE is used to setup | |||
| 114 | (flymake-tests--with-flymake ("test.pl") | 114 | (flymake-tests--with-flymake ("test.pl") |
| 115 | (flymake-goto-next-error) | 115 | (flymake-goto-next-error) |
| 116 | (should (eq 'flymake-warning (face-at-point))) | 116 | (should (eq 'flymake-warning (face-at-point))) |
| 117 | (flymake-goto-next-error) | 117 | (goto-char (point-max)) |
| 118 | (flymake-goto-prev-error) | ||
| 118 | (should (eq 'flymake-error (face-at-point))))) | 119 | (should (eq 'flymake-error (face-at-point))))) |
| 119 | 120 | ||
| 120 | (ert-deftest ruby-backend () | 121 | (ert-deftest ruby-backend () |
| 121 | "Test the ruby backend" | 122 | "Test the ruby backend" |
| 122 | (skip-unless (executable-find "ruby")) | 123 | (skip-unless (executable-find "ruby")) |
| 123 | (flymake-tests--with-flymake ("test.rb") | 124 | ;; Some versions of ruby fail if HOME doesn't exist (bug#29187). |
| 124 | (flymake-goto-next-error) | 125 | (let* ((tempdir (make-temp-file "flymake-tests-ruby" t)) |
| 125 | (should (eq 'flymake-warning (face-at-point))) | 126 | (process-environment (cons (format "HOME=%s" tempdir) |
| 126 | (flymake-goto-next-error) | 127 | process-environment))) |
| 127 | (should (eq 'flymake-error (face-at-point))))) | 128 | (unwind-protect |
| 129 | (flymake-tests--with-flymake ("test.rb") | ||
| 130 | (flymake-goto-next-error) | ||
| 131 | (should (eq 'flymake-warning (face-at-point))) | ||
| 132 | (flymake-goto-next-error) | ||
| 133 | (should (eq 'flymake-error (face-at-point)))) | ||
| 134 | (delete-directory tempdir t)))) | ||
| 128 | 135 | ||
| 129 | (ert-deftest different-diagnostic-types () | 136 | (ert-deftest different-diagnostic-types () |
| 130 | "Test GCC warning via function predicate." | 137 | "Test GCC warning via function predicate." |