Patchwork D1873: hghave: add test for clang 6 and later

login
register
mail settings
Submitter phabricator
Date Jan. 17, 2018, 9:31 p.m.
Message ID <differential-rev-PHID-DREV-u7oes76mf2mdbuyl3l6q-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26824/
State Superseded
Headers show

Comments

phabricator - Jan. 17, 2018, 9:31 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  clang 6 includes integrated libfuzzer support, which makes fuzzer
  stuff a little easier to work with.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1873

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -700,3 +700,11 @@ 
         return True
     except ImportError:
         return False
+
+@check("clang-libfuzzer", "clang new enough to include libfuzzer")
+def has_clang_libfuzzer():
+    mat = matchoutput('clang --version', 'clang version (\d)')
+    if mat:
+        # libfuzzer is new in clang 6
+        return int(mat.group(1)) > 5
+    return False