Patchwork [7,of,7] test-fuzz-targets: look for clang-6.0 binary as well

login
register
mail settings
Submitter Yuya Nishihara
Date June 3, 2018, 6:43 a.m.
Message ID <487263b9525368d3ceb1.1528008225@mimosa>
Download mbox | patch
Permalink /patch/31945/
State Accepted
Headers show

Comments

Yuya Nishihara - June 3, 2018, 6:43 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1528000858 -32400
#      Sun Jun 03 13:40:58 2018 +0900
# Node ID 487263b9525368d3ceb116ae0a86fcd8e1e3916c
# Parent  3e0005d37e872e95bfc2a9ae092c0db9d412315b
test-fuzz-targets: look for clang-6.0 binary as well

Debian sid is still shipped with clang 4.0 by default. This allows me to
run the test without replacing the system clang to clang-6.0.
Augie Fackler - June 4, 2018, 2:39 a.m.
On Sun, Jun 03, 2018 at 03:43:45PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1528000858 -32400
> #      Sun Jun 03 13:40:58 2018 +0900
> # Node ID 487263b9525368d3ceb116ae0a86fcd8e1e3916c
> # Parent  3e0005d37e872e95bfc2a9ae092c0db9d412315b
> test-fuzz-targets: look for clang-6.0 binary as well

queued, thanks

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -709,6 +709,10 @@  def has_clang_libfuzzer():
         return int(mat.group(1)) > 5
     return False
 
+@check("clang-6.0", "clang 6.0 with version suffix (libfuzzer included)")
+def has_clang60():
+    return matchoutput('clang-6.0 --version', b'clang version 6\.')
+
 @check("xdiff", "xdiff algorithm")
 def has_xdiff():
     try:
diff --git a/tests/test-fuzz-targets.t b/tests/test-fuzz-targets.t
--- a/tests/test-fuzz-targets.t
+++ b/tests/test-fuzz-targets.t
@@ -1,6 +1,17 @@ 
-#require clang-libfuzzer test-repo
+#require test-repo
+
   $ cd $TESTDIR/../contrib/fuzz
+
+#if clang-libfuzzer
   $ make -s clean all
+#endif
+#if no-clang-libfuzzer clang-6.0
+  $ make -s clean all CC=clang-6.0 CXX=clang++-6.0
+#endif
+#if no-clang-libfuzzer no-clang-6.0
+  $ exit 80
+#endif
+
 Just run the fuzzers for five seconds each to verify it works at all.
   $ ./bdiff -max_total_time 5
   $ ./xdiff -max_total_time 5