From b4632b2afb0aff4d1b2d1c7fd40d7ee26b228eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sun, 2 Jan 2022 13:00:13 +0100 Subject: [PATCH 1/2] Don't fail flymake-tests if `gcc` actually is Clang To: emacs-devel@gnu.org * test/lisp/progmodes/flymake-tests.el (flymake-tests--gcc-is-clang) (different-diagnostic-types, included-c-header-files): Skip tests that depend on the `gcc` command really being GCC and not Clang. (cherry picked from commit b2167d98432a78442522b7564e22f47d75a98b6f) --- test/lisp/progmodes/flymake-tests.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 2eb4004f10..45cabf2efb 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -140,9 +140,15 @@ ruby-backend (should (eq 'flymake-error (face-at-point))))) (delete-directory tempdir t)))) +(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") + (not (flymake-tests--gcc-is-clang)) (version<= "5" (string-trim (shell-command-to-string "gcc -dumpversion"))) @@ -166,7 +172,9 @@ different-diagnostic-types (ert-deftest included-c-header-files () "Test inclusion of .h header files." - (skip-unless (and (executable-find "gcc") (executable-find "make"))) + (skip-unless (and (executable-find "gcc") + (not (flymake-tests--gcc-is-clang)) + (executable-find "make"))) (let ((flymake-wrap-around nil)) (flymake-tests--with-flymake ("some-problems.h") -- 2.34.0