[PATCH] D17335: [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 07:19:06 PST 2016


alexfh added inline comments.

================
Comment at: test/clang-tidy/clang-tidy-run-with-database.cpp:2
@@ +1,3 @@
+// REQUIRES: shell
+// RUN: mkdir -p %T/compilation-database-test
+// RUN: mkdir -p %T/compilation-database-test/include
----------------
You don't need to create the root directory, since the `mkdir -p` calls below will take care of this.

================
Comment at: test/clang-tidy/clang-tidy-run-with-database.cpp:15
@@ +14,3 @@
+// RUN: clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/a/a.cpp %T/compilation-database-test/a/b.cpp %T/compilation-database-test/b/b.cpp %T/compilation-database-test/b/c.cpp %T/compilation-database-test/b/d.cpp -header-filter=.* -fix
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: FileCheck -input-file=%T/compilation-database-test/a/a.cpp %t.cpp -check-prefix=CHECK-FIX1
----------------
I'm not sure how the rest of the test works. This `grep -v` call leaves everything __except__ for the CHECK-lines in the %t.cpp, doesn't it?

================
Comment at: test/clang-tidy/clang-tidy-run-with-database.cpp:16
@@ +15,3 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: FileCheck -input-file=%T/compilation-database-test/a/a.cpp %t.cpp -check-prefix=CHECK-FIX1
+// RUN: FileCheck -input-file=%T/compilation-database-test/a/b.cpp %t.cpp -check-prefix=CHECK-FIX2
----------------
Why don't you use `%s` here?


http://reviews.llvm.org/D17335





More information about the cfe-commits mailing list