[clang-tools-extra] r372607 - Added a test for agreement between paths used in ClangTidy's diagnostics and header filter
Dmitri Gribenko via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 23 06:44:42 PDT 2019
Author: gribozavr
Date: Mon Sep 23 06:44:42 2019
New Revision: 372607
URL: http://llvm.org/viewvc/llvm-project?rev=372607&view=rev
Log:
Added a test for agreement between paths used in ClangTidy's diagnostics and header filter
This test would have been broken by r372388.
Added:
clang-tools-extra/trunk/test/clang-tidy/file-filter-symlinks.cpp
Added: clang-tools-extra/trunk/test/clang-tidy/file-filter-symlinks.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/file-filter-symlinks.cpp?rev=372607&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/file-filter-symlinks.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/file-filter-symlinks.cpp Mon Sep 23 06:44:42 2019
@@ -0,0 +1,19 @@
+// REQUIRES: shell
+
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/dir1/dir2
+// RUN: echo 'class A { A(int); };' > %t/dir1/header.h
+// RUN: ln -s %t/dir1/header.h %t/dir1/header_alias.h
+//
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='dir1/dir2/\.\./header_alias\.h' %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER_ALIAS %s
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='dir1/dir2/\.\./header_alias\.h' -quiet %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER_ALIAS %s
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header_alias\.h' %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER_ALIAS %s
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header_alias\.h' -quiet %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER_ALIAS %s
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header\.h' %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER %s
+// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header\.h' -quiet %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER %s
+
+// Check that `-header-filter` operates on the same file paths as paths in
+// diagnostics printed by ClangTidy.
+#include "dir1/dir2/../header_alias.h"
+// CHECK_HEADER_ALIAS: dir1/dir2/../header_alias.h:1:11: warning: single-argument constructors
+// CHECK_HEADER-NOT: warning:
More information about the cfe-commits
mailing list