summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/test/Makefile1
-rw-r--r--clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp3
-rw-r--r--clang-tools-extra/test/lit.cfg7
-rw-r--r--clang-tools-extra/test/lit.site.cfg.in1
4 files changed, 11 insertions, 1 deletions
diff --git a/clang-tools-extra/test/Makefile b/clang-tools-extra/test/Makefile
index 6e398376341..1dcf7cd27c1 100644
--- a/clang-tools-extra/test/Makefile
+++ b/clang-tools-extra/test/Makefile
@@ -52,6 +52,7 @@ lit.site.cfg: FORCE
@$(ECHOPATH) s=@CLANG_TOOLS_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> lit.tmp
@$(ECHOPATH) s=@CLANG_TOOLS_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> lit.tmp
@$(ECHOPATH) s=@CLANG_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
+ @$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
@-rm -f lit.tmp
diff --git a/clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp b/clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp
index ab0b0f1418f..159431dec58 100644
--- a/clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp
+++ b/clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp
@@ -1,6 +1,7 @@
+// REQUIRES: python27
// RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
// RUN: clang-tidy -checks=-*,misc-use-override %t.cpp -- -std=c++11 | FileCheck -check-prefix=CHECK-SANITY %s
-// R_U_N: not diff -U0 %s %t.cpp | python %S/../../clang-tidy/tool/clang-tidy-diff.py -checks=-*,misc-use-override -- -std=c++11 2>&1 | FileCheck %s
+// RUN: not diff -U0 %s %t.cpp | %python %S/../../clang-tidy/tool/clang-tidy-diff.py -checks=-*,misc-use-override -- -std=c++11 2>&1 | FileCheck %s
struct A {
virtual void f() {}
virtual void g() {}
diff --git a/clang-tools-extra/test/lit.cfg b/clang-tools-extra/test/lit.cfg
index 41a17cbce72..c58f54e731b 100644
--- a/clang-tools-extra/test/lit.cfg
+++ b/clang-tools-extra/test/lit.cfg
@@ -174,3 +174,10 @@ if platform.system() not in ['Windows'] or lit_config.getBashPath() != '':
# ANSI escape sequences in non-dumb terminal
if platform.system() not in ['Windows']:
config.available_features.add('ansi-escape-sequences')
+
+config.substitutions.append( ('%python', config.python_executable) )
+
+import sys
+# Scripts using argparse need Python 2.7.
+if sys.version_info >= (2, 7):
+ config.available_features.add('python27')
diff --git a/clang-tools-extra/test/lit.site.cfg.in b/clang-tools-extra/test/lit.site.cfg.in
index 277f648c59c..35f85168cbe 100644
--- a/clang-tools-extra/test/lit.site.cfg.in
+++ b/clang-tools-extra/test/lit.site.cfg.in
@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
+config.python_executable = "@PYTHON_EXECUTABLE@"
config.target_triple = "@TARGET_TRIPLE@"
# Support substitution of the tools and libs dirs with user parameters. This is
OpenPOWER on IntegriCloud