From: Stefan Monnier Date: Wed, 12 Jan 2022 20:57:29 +0000 (-0500) Subject: Merge remote-tracking branch 'origin/emacs-28' into trunk X-Git-Tag: emacs-29.0.90~3108 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=917a623a9dd21bc1d73fd13d91de57d924ce2692;p=emacs.git Merge remote-tracking branch 'origin/emacs-28' into trunk --- 917a623a9dd21bc1d73fd13d91de57d924ce2692 diff --cc test/lisp/progmodes/flymake-tests.el index ced7b5aaced,45cabf2efba..0793b2bfdab --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@@ -124,27 -123,28 +124,32 @@@ SEVERITY-PREDICATE is used to setu "Test the ruby backend." (skip-unless (executable-find "ruby")) ;; 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)) - ;; And see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19657#20 - ;; for this particular yuckiness - (abbreviated-home-dir nil)) - (unwind-protect - (let ((ruby-mode-hook - (lambda () - (setq flymake-diagnostic-functions '(ruby-flymake-simple))))) - (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-with-temp-directory tempdir + :suffix "flymake-tests-ruby" + (let* ((process-environment (cons (format "HOME=%s" tempdir) + process-environment)) + ;; And see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19657#20 + ;; for this particular yuckiness + (abbreviated-home-dir nil) + (ruby-mode-hook + (lambda () + (setq flymake-diagnostic-functions '(ruby-flymake-simple))))) + (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))))))) + +(defun flymake-tests--gcc-is-clang () + "Whether the `gcc' command actually runs the Clang compiler." + (string-match "[Cc]lang version " + (shell-command-to-string "gcc --version"))) + (defun flymake-tests--gcc-is-clang () + "Whether the `gcc' command actually runs the Clang compiler." + (string-match "[Cc]lang version " + (shell-command-to-string "gcc --version"))) + (ert-deftest different-diagnostic-types () "Test GCC warning via function predicate." (skip-unless (and (executable-find "gcc")