summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/include-fixer/include_path.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-06-08 15:10:18 +0000
committerHaojian Wu <hokein@google.com>2016-06-08 15:10:18 +0000
commit13d3048cedad51123d42fea730d30bcfaa7967fb (patch)
tree60058a8efdb518c1c14270ab6969e244901d00e4 /clang-tools-extra/test/include-fixer/include_path.cpp
parent81689dab6cd9747fd61178a4e842a3e5f4080224 (diff)
downloadbcm5719-llvm-13d3048cedad51123d42fea730d30bcfaa7967fb.tar.gz
bcm5719-llvm-13d3048cedad51123d42fea730d30bcfaa7967fb.zip
[include-fixer] Keep dot dot in SymbolInfo file paths.
Summary: Currently, removing dot dot in header's path doesn't make include-fixer minimize path correctly in some cases, for example, specify a relative search path based on the build directory("-I../include/"). Besides, removing dot dot can break symbolic link directories. So don't removing it for now. Reviewers: ioeric, bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21132 llvm-svn: 272152
Diffstat (limited to 'clang-tools-extra/test/include-fixer/include_path.cpp')
-rw-r--r--clang-tools-extra/test/include-fixer/include_path.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/clang-tools-extra/test/include-fixer/include_path.cpp b/clang-tools-extra/test/include-fixer/include_path.cpp
index b1b6329b961..31ae52eb122 100644
--- a/clang-tools-extra/test/include-fixer/include_path.cpp
+++ b/clang-tools-extra/test/include-fixer/include_path.cpp
@@ -1,14 +1,20 @@
// REQUIRES: shell
// RUN: mkdir -p %T/include-fixer/include
+// RUN: mkdir -p %T/include-fixer/symbols
// RUN: mkdir -p %T/include-fixer/build
// RUN: mkdir -p %T/include-fixer/src
// RUN: sed 's|test_dir|%T/include-fixer|g' %S/Inputs/database_template.json > %T/include-fixer/build/compile_commands.json
-// RUN: cp %S/Inputs/fake_yaml_db.yaml %T/include-fixer/build/fake_yaml_db.yaml
-// RUN: echo 'b::a::bar f;' > %T/include-fixer/src/bar.cpp
-// RUN: touch %T/include-fixer/include/bar.h
+// RUN: echo -e '#include "bar.h"\nb::a::bar f;' > %T/include-fixer/src/bar.cpp
+// RUN: echo 'namespace b { namespace a { class bar {}; } }' > %T/include-fixer/include/bar.h
// RUN: cd %T/include-fixer/build
-// RUN: clang-include-fixer -db=yaml -input=fake_yaml_db.yaml -minimize-paths=true -p=. %T/include-fixer/src/bar.cpp
+// RUN: find-all-symbols -output-dir=%T/include-fixer/symbols -p=. %T/include-fixer/src/bar.cpp
+// RUN: find-all-symbols -merge-dir=%T/include-fixer/symbols %T/include-fixer/build/find_all_symbols.yaml
+// RUN: FileCheck -input-file=%T/include-fixer/build/find_all_symbols.yaml -check-prefix=CHECK-YAML %s
+//
+// RUN: echo 'b::a::bar f;' > %T/include-fixer/src/bar.cpp
+// RUN: clang-include-fixer -db=yaml -input=%T/include-fixer/build/find_all_symbols.yaml -minimize-paths=true -p=. %T/include-fixer/src/bar.cpp
// RUN: FileCheck -input-file=%T/include-fixer/src/bar.cpp %s
+// CHECK-YAML: ../include/bar.h
// CHECK: #include "bar.h"
// CHECK: b::a::bar f;
OpenPOWER on IntegriCloud