[clang-tools-extra] r211789 - Make the clang-tidy-diff.py test conditional on the presence of Python 2.7. Use the python binary from the configuration.

Alexander Kornienko alexfh at google.com
Thu Jun 26 09:32:26 PDT 2014


Author: alexfh
Date: Thu Jun 26 11:32:26 2014
New Revision: 211789

URL: http://llvm.org/viewvc/llvm-project?rev=211789&view=rev
Log:
Make the clang-tidy-diff.py test conditional on the presence of Python 2.7. Use the python binary from the configuration.

Modified:
    clang-tools-extra/trunk/test/Makefile
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp
    clang-tools-extra/trunk/test/lit.cfg
    clang-tools-extra/trunk/test/lit.site.cfg.in

Modified: clang-tools-extra/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/Makefile?rev=211789&r1=211788&r2=211789&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/Makefile (original)
+++ clang-tools-extra/trunk/test/Makefile Thu Jun 26 11:32:26 2014
@@ -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

Modified: clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp?rev=211789&r1=211788&r2=211789&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/clang-tidy-diff.cpp Thu Jun 26 11:32:26 2014
@@ -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() {}

Modified: clang-tools-extra/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/lit.cfg?rev=211789&r1=211788&r2=211789&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/lit.cfg (original)
+++ clang-tools-extra/trunk/test/lit.cfg Thu Jun 26 11:32:26 2014
@@ -174,3 +174,10 @@ if platform.system() not in ['Windows']
 # 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')

Modified: clang-tools-extra/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/lit.site.cfg.in?rev=211789&r1=211788&r2=211789&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/lit.site.cfg.in (original)
+++ clang-tools-extra/trunk/test/lit.site.cfg.in Thu Jun 26 11:32:26 2014
@@ -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





More information about the cfe-commits mailing list