[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 81c6569e654: Flymake: unbreak tests
From: |
João Távora |
Subject: |
master 81c6569e654: Flymake: unbreak tests |
Date: |
Sun, 24 Sep 2023 04:04:47 -0400 (EDT) |
branch: master
commit 81c6569e654966c63f208013a4faf7ddb2a5d933
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Flymake: unbreak tests
Flymake's normal behaviour implies catching the errors of misbehaving
backends. This behavior is tested by Flymake's automated tests, built
on top of ERT, which means that debug-on-error is always t in the
bodies of said tests (I don't know the rationale for this, but it's
been like this for some time)
Flymake used to shun usage of 'condition-case-unless-debug' because of
this. But since that macro is pretty useful, I started using it
again, and as a consequence, tests started breaking.
The solution is to:
1. stop requiring the deprecated legacy backend 'flymake-proc' (which
by design, always errors, except in rare circumstances).
2. deliberately set debug-on-error to nil around the "dummy backends""
test.
* lisp/progmodes/flymake.el (flymake-proc): Don't require it by
default.
* test/lisp/progmodes/flymake-tests.el:
(dummy-backends): Make robust to ert's debug-on-error setting.
---
lisp/progmodes/flymake.el | 2 --
test/lisp/progmodes/flymake-tests.el | 3 ++-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 6fabea3bda8..b27e6527f81 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1977,6 +1977,4 @@ some of this variable's contents the diagnostic
listings.")
(provide 'flymake)
-(require 'flymake-proc)
-
;;; flymake.el ends here
diff --git a/test/lisp/progmodes/flymake-tests.el
b/test/lisp/progmodes/flymake-tests.el
index f6608dffca2..c3ef4827ef2 100644
--- a/test/lisp/progmodes/flymake-tests.el
+++ b/test/lisp/progmodes/flymake-tests.el
@@ -213,6 +213,7 @@ SEVERITY-PREDICATE is used to setup
(ert-deftest dummy-backends ()
"Test many different kinds of backends."
+ (let ((debug-on-error nil))
(with-temp-buffer
(cl-letf
(((symbol-function 'error-backend)
@@ -291,7 +292,7 @@ SEVERITY-PREDICATE is used to setup
(should (eq 'flymake-warning (face-at-point))) ; dolor
(flymake-goto-next-error)
(should (eq 'flymake-error (face-at-point))) ; prognata
- (should-error (flymake-goto-next-error nil nil t))))))
+ (should-error (flymake-goto-next-error nil nil t)))))))
(ert-deftest recurrent-backend ()
"Test a backend that calls REPORT-FN multiple times."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 81c6569e654: Flymake: unbreak tests,
João Távora <=