1// REQUIRES: shell
2
3// RUN: rm -rf %t
4// RUN: mkdir -p %t/dir1/dir2
5// RUN: echo 'class A { A(int); };' > %t/dir1/header.h
6// RUN: ln -s %t/dir1/header.h %t/dir1/header_alias.h
7//
8// 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
9// 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
10// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header_alias\.h' %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER_ALIAS %s
11// 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
12// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header\.h' %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER %s
13// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='header\.h' -quiet %s -- -I %t 2>&1 | FileCheck --check-prefix=CHECK_HEADER %s
14
15// Check that `-header-filter` operates on the same file paths as paths in
16// diagnostics printed by ClangTidy.
17#include "dir1/dir2/../header_alias.h"
18// CHECK_HEADER_ALIAS: dir1/dir2/../header_alias.h:1:11: warning: single-argument constructors
19// CHECK_HEADER-NOT: warning:
20

source code of clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp