changeset 38236:a6347ae6168d

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.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Jun 2018 13:40:58 +0900
parents 9b681bb9df9b
children 66fc2ef8dbff
files tests/hghave.py tests/test-fuzz-targets.t
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Sun Jun 03 13:23:12 2018 +0900
+++ b/tests/hghave.py	Sun Jun 03 13:40:58 2018 +0900
@@ -709,6 +709,10 @@
         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:
--- a/tests/test-fuzz-targets.t	Sun Jun 03 13:23:12 2018 +0900
+++ b/tests/test-fuzz-targets.t	Sun Jun 03 13:40:58 2018 +0900
@@ -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