tstellar / rpms / clang

Forked from rpms/clang 6 years ago
Clone
b836ed8
From c4d409e8481e402eb34739c6579bd9ffe383f3cd Mon Sep 17 00:00:00 2001
b836ed8
From: Tom Stellard <tstellar@redhat.com>
b836ed8
Date: Fri, 16 Jun 2017 00:48:27 +0000
b836ed8
Subject: [PATCH] lit.cfg: Remove substitutions for clang/llvm tools
b836ed8
b836ed8
We were missing some subsitutions, for example 'not with no pipe, so
b836ed8
there was a mismatch where some tests would run tools using the full
b836ed8
path and others would search PATH for the tool.
b836ed8
b836ed8
The new beahavior is that the lit tests will always search PATH for the
b836ed8
tool.  This should not change the current functionality, because the
b836ed8
smae paths that were being used in substitutions are being added to
b836ed8
PATH.
b836ed8
---
b836ed8
 test/lit.cfg | 42 ------------------------------------------
b836ed8
 1 file changed, 42 deletions(-)
b836ed8
b836ed8
diff --git a/test/lit.cfg b/test/lit.cfg
b836ed8
index 7d8bebf..9ded96c 100644
b836ed8
--- a/test/lit.cfg
b836ed8
+++ b/test/lit.cfg
b836ed8
@@ -303,48 +303,6 @@ config.substitutions.append(
b836ed8
     (' %clang-cl ',
b836ed8
      """*** invalid substitution, use '%clang_cl'. ***""") )
b836ed8
 
b836ed8
-# For each occurrence of a clang tool name as its own word, replace it
b836ed8
-# with the full path to the build directory holding that tool.  This
b836ed8
-# ensures that we are testing the tools just built and not some random
b836ed8
-# tools that might happen to be in the user's PATH.
b836ed8
-tool_dirs = os.path.pathsep.join((clang_tools_dir, llvm_tools_dir))
b836ed8
-
b836ed8
-# Regex assertions to reject neighbor hyphens/dots (seen in some tests).
b836ed8
-# For example, don't match 'clang-check-' or '.clang-format'.
b836ed8
-NoPreHyphenDot = r"(?
b836ed8
-NoPostHyphenDot = r"(?!(-|\.))"
b836ed8
-NoPostBar = r"(?!(/|\\))"
b836ed8
-
b836ed8
-tool_patterns = [r"\bFileCheck\b",
b836ed8
-                 r"\bc-index-test\b",
b836ed8
-                 NoPreHyphenDot + r"\bclang-check\b" + NoPostHyphenDot,
b836ed8
-                 NoPreHyphenDot + r"\bclang-format\b" + NoPostHyphenDot,
b836ed8
-                 # FIXME: Some clang test uses opt?
b836ed8
-                 NoPreHyphenDot + r"\bopt\b" + NoPostBar + NoPostHyphenDot,
b836ed8
-                 # Handle these specially as they are strings searched
b836ed8
-                 # for during testing.
b836ed8
-                 r"\| \bcount\b",
b836ed8
-                 r"\| \bnot\b"]
b836ed8
-
b836ed8
-if config.clang_examples:
b836ed8
-    tool_patterns.append(NoPreHyphenDot + r"\bclang-interpreter\b" + NoPostHyphenDot)
b836ed8
-
b836ed8
-for pattern in tool_patterns:
b836ed8
-    # Extract the tool name from the pattern.  This relies on the tool
b836ed8
-    # name being surrounded by \b word match operators.  If the
b836ed8
-    # pattern starts with "| ", include it in the string to be
b836ed8
-    # substituted.
b836ed8
-    tool_match = re.match(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
b836ed8
-                          pattern)
b836ed8
-    tool_pipe = tool_match.group(2)
b836ed8
-    tool_name = tool_match.group(4)
b836ed8
-    tool_path = lit.util.which(tool_name, tool_dirs)
b836ed8
-    if not tool_path:
b836ed8
-        # Warn, but still provide a substitution.
b836ed8
-        lit_config.note('Did not find ' + tool_name + ' in ' + tool_dirs)
b836ed8
-        tool_path = clang_tools_dir + '/' + tool_name
b836ed8
-    config.substitutions.append((pattern, tool_pipe + tool_path))
b836ed8
-
b836ed8
 ###
b836ed8
 
b836ed8
 # Set available features we allow tests to conditionalize on.
b836ed8
-- 
b836ed8
2.9.3
b836ed8