diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2022-01-02 13:00:13 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2022-01-02 13:59:07 +0100 |
commit | b2167d98432a78442522b7564e22f47d75a98b6f (patch) | |
tree | 4172f5f7754e3be2dee8b3d2c8e56ced95633fb8 /test/lisp/progmodes | |
parent | be6b9e45805f99a70617f7a190f8c76a80543b6c (diff) | |
download | emacs-b2167d98432a78442522b7564e22f47d75a98b6f.tar.gz emacs-b2167d98432a78442522b7564e22f47d75a98b6f.tar.bz2 emacs-b2167d98432a78442522b7564e22f47d75a98b6f.zip |
Don't fail flymake-tests if `gcc` actually is Clang
* 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.
Diffstat (limited to 'test/lisp/progmodes')
-rw-r--r-- | test/lisp/progmodes/flymake-tests.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 9e5147726f9..ced7b5aaced 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -140,9 +140,15 @@ SEVERITY-PREDICATE is used to setup (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"))) + (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 @@ SEVERITY-PREDICATE is used to setup (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") |