emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 0da08f2: Protect Flymake tests against older Ruby


From: João Távora
Subject: [Emacs-diffs] emacs-26 0da08f2: Protect Flymake tests against older Ruby and Perl (bug#29187)
Date: Thu, 9 Nov 2017 04:44:13 -0500 (EST)

branch: emacs-26
commit 0da08f2f8ef1946978f0974e9e8cdb87fece018c
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    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
---
 test/lisp/progmodes/flymake-tests.el | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/test/lisp/progmodes/flymake-tests.el 
b/test/lisp/progmodes/flymake-tests.el
index c60f910..05214e7 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
   (flymake-tests--with-flymake ("test.pl")
     (flymake-goto-next-error)
     (should (eq 'flymake-warning (face-at-point)))
-    (flymake-goto-next-error)
+    (goto-char (point-max))
+    (flymake-goto-prev-error)
     (should (eq 'flymake-error (face-at-point)))))
 
 (ert-deftest ruby-backend ()
   "Test the ruby backend"
   (skip-unless (executable-find "ruby"))
-  (flymake-tests--with-flymake ("test.rb")
-    (flymake-goto-next-error)
-    (should (eq 'flymake-warning (face-at-point)))
-    (flymake-goto-next-error)
-    (should (eq 'flymake-error (face-at-point)))))
+  ;; Some versions of ruby fail if HOME doesn't exist (bug#29187).
+  (let* ((tempdir (make-temp-file "flymake-tests-ruby" t))
+         (process-environment (cons (format "HOME=%s" tempdir)
+                                    process-environment)))
+    (unwind-protect
+        (flymake-tests--with-flymake ("test.rb")
+          (flymake-goto-next-error)
+          (should (eq 'flymake-warning (face-at-point)))
+          (flymake-goto-next-error)
+          (should (eq 'flymake-error (face-at-point))))
+      (delete-directory tempdir t))))
 
 (ert-deftest different-diagnostic-types ()
   "Test GCC warning via function predicate."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]