• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: mkdir -p %T/clang-include-fixer/include
2 // RUN: mkdir -p %T/clang-include-fixer/symbols
3 // RUN: mkdir -p %T/clang-include-fixer/build
4 // RUN: mkdir -p %T/clang-include-fixer/src
5 // RUN: sed 's|test_dir|%/T/clang-include-fixer|g' %S/Inputs/database_template.json > %T/clang-include-fixer/build/compile_commands.json
6 // RUN: echo -e '#include "bar.h"\nb::a::bar f;' > %T/clang-include-fixer/src/bar.cpp
7 // RUN: echo 'namespace b { namespace a { class bar {}; } }' > %T/clang-include-fixer/include/bar.h
8 // RUN: cd %T/clang-include-fixer/build
9 // RUN: find-all-symbols -output-dir=%T/clang-include-fixer/symbols -p=. %T/clang-include-fixer/src/bar.cpp
10 // RUN: find-all-symbols -merge-dir=%T/clang-include-fixer/symbols %T/clang-include-fixer/build/find_all_symbols.yaml
11 // RUN: FileCheck -input-file=%T/clang-include-fixer/build/find_all_symbols.yaml -check-prefix=CHECK-YAML %s
12 //
13 // RUN: echo 'b::a::bar f;' > %T/clang-include-fixer/src/bar.cpp
14 // RUN: clang-include-fixer -db=yaml -input=%T/clang-include-fixer/build/find_all_symbols.yaml -minimize-paths=true -p=. %T/clang-include-fixer/src/bar.cpp
15 // RUN: FileCheck -input-file=%T/clang-include-fixer/src/bar.cpp %s
16 
17 // CHECK-YAML: ..{{[/\\]}}include{{[/\\]}}bar.h
18 // CHECK: #include "bar.h"
19 // CHECK: b::a::bar f;
20