[PATCH] D12180: [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests.

NAKAMURA Takumi via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 07:34:01 PDT 2015


chapuni added a comment.

Alex, thanks for your working. I tweaked to run on my hosts.

- mingw-w64 with Py3.3
- Linux with Py2.7 and Py3.4

My change is here; https://github.com/chapuni/llvm-project/commit/0f4a303bdc7b925f42c0cd48817052d2b49b2234
Could you merge it, please?


================
Comment at: test/clang-tidy/arg-comments.cpp:1
@@ -1,3 +1,2 @@
-// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-argument-comment %t
-// REQUIRES: shell
+// RUN: $(dirname %s)/check_clang_tidy.py %s misc-argument-comment %t
 
----------------
$(dirname %s) assumes shell. use %S instead.
Lit internal runner is not capable of !shbang. use %python.

  // RUN: %python %S/check_clang_tidy.py %s misc-argument-comment %t

================
Comment at: test/clang-tidy/check_clang_tidy.py:71
@@ +70,3 @@
+  print('Running ' + repr(args) + '...')
+  clang_tidy_output = subprocess.check_output(args, stderr=subprocess.STDOUT)
+
----------------
It is not string, but bytes. It wouldn't run on py3.

  +  clang_tidy_output = subprocess.check_output(args, stderr=subprocess.STDOUT).decode()

================
Comment at: test/clang-tidy/check_clang_tidy.py:85
@@ +84,3 @@
+  print('------------------------------ Fixes -----------------------------\n' +
+        diff_output +
+        '\n------------------------------------------------------------------')
----------------
It cannot be concatenated to string. Use encode.

  +        diff_output.decode() +

================
Comment at: test/clang-tidy/google-readability-casting.c:7
@@ -6,3 +6,3 @@
 // RUN: clang-tidy --checks=-*,google-readability-casting -header-filter='.*' %t.main_file.cpp -- -I%S -DTEST_INCLUDE -x c++ | FileCheck %s -check-prefix=CHECK-MESSAGES -implicit-check-not='{{warning|error}}:'
 // REQUIRES: shell
 
----------------
It can be pruned.

================
Comment at: test/clang-tidy/misc-unused-parameters.cpp:5
@@ -4,3 +4,3 @@
 // RUN: diff %T/header.h %T/header-fixed.h
 // REQUIRES: shell
 
----------------
It can be pruned.


http://reviews.llvm.org/D12180





More information about the cfe-commits mailing list