summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-05-31 12:12:19 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-05-31 12:12:19 +0000
commit03016b85b6e21992f6d50c91c9be5cb8a5341f5c (patch)
tree62ad6ade592295a7a69d36efcabff9f19a0b74ef
parente05dc458976ee10a5fbb828cb659129a1f2674cf (diff)
downloadbcm5719-llvm-03016b85b6e21992f6d50c91c9be5cb8a5341f5c.tar.gz
bcm5719-llvm-03016b85b6e21992f6d50c91c9be5cb8a5341f5c.zip
[find-all-symbols] Add a test to make sure merging actually works.
llvm-svn: 271270
-rw-r--r--clang-tools-extra/test/CMakeLists.txt1
-rw-r--r--clang-tools-extra/test/include-fixer/Inputs/merge/a.yaml20
-rw-r--r--clang-tools-extra/test/include-fixer/Inputs/merge/b.yaml20
-rw-r--r--clang-tools-extra/test/include-fixer/merge.test34
-rw-r--r--clang-tools-extra/test/lit.cfg2
5 files changed, 76 insertions, 1 deletions
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt
index 4dc475af8ee..22ee4ee56dd 100644
--- a/clang-tools-extra/test/CMakeLists.txt
+++ b/clang-tools-extra/test/CMakeLists.txt
@@ -46,6 +46,7 @@ set(CLANG_TOOLS_TEST_DEPS
clang-query
clang-rename
clang-tidy
+ find-all-symbols
modularize
pp-trace
diff --git a/clang-tools-extra/test/include-fixer/Inputs/merge/a.yaml b/clang-tools-extra/test/include-fixer/Inputs/merge/a.yaml
new file mode 100644
index 00000000000..8c8f64ae301
--- /dev/null
+++ b/clang-tools-extra/test/include-fixer/Inputs/merge/a.yaml
@@ -0,0 +1,20 @@
+---
+Name: foo
+Contexts:
+ - ContextType: Namespace
+ ContextName: a
+FilePath: foo.h
+LineNumber: 1
+Type: Class
+NumOccurrences: 1
+...
+---
+Name: bar
+Contexts:
+ - ContextType: Namespace
+ ContextName: a
+FilePath: ../include/bar.h
+LineNumber: 1
+Type: Class
+NumOccurrences: 1
+...
diff --git a/clang-tools-extra/test/include-fixer/Inputs/merge/b.yaml b/clang-tools-extra/test/include-fixer/Inputs/merge/b.yaml
new file mode 100644
index 00000000000..f5346b2e904
--- /dev/null
+++ b/clang-tools-extra/test/include-fixer/Inputs/merge/b.yaml
@@ -0,0 +1,20 @@
+---
+Name: foo
+Contexts:
+ - ContextType: Namespace
+ ContextName: a
+FilePath: foo.h
+LineNumber: 1
+Type: Class
+NumOccurrences: 1
+...
+---
+Name: bar
+Contexts:
+ - ContextType: Namespace
+ ContextName: a
+FilePath: ../include/barbar.h
+LineNumber: 1
+Type: Class
+NumOccurrences: 1
+...
diff --git a/clang-tools-extra/test/include-fixer/merge.test b/clang-tools-extra/test/include-fixer/merge.test
new file mode 100644
index 00000000000..a2344fafa2c
--- /dev/null
+++ b/clang-tools-extra/test/include-fixer/merge.test
@@ -0,0 +1,34 @@
+# REQUIRES: shell
+# RUN: find-all-symbols -merge-dir=%S/Inputs/merge %t.merged
+# RUN: sed '/^#/d' %s > %t.golden
+# RUN: diff -u %t.golden %t.merged
+---
+Name: bar
+Contexts:
+ - ContextType: Namespace
+ ContextName: a
+FilePath: ../include/bar.h
+LineNumber: 1
+Type: Class
+NumOccurrences: 1
+...
+---
+Name: bar
+Contexts:
+ - ContextType: Namespace
+ ContextName: a
+FilePath: ../include/barbar.h
+LineNumber: 1
+Type: Class
+NumOccurrences: 1
+...
+---
+Name: foo
+Contexts:
+ - ContextType: Namespace
+ ContextName: a
+FilePath: foo.h
+LineNumber: 1
+Type: Class
+NumOccurrences: 2
+...
diff --git a/clang-tools-extra/test/lit.cfg b/clang-tools-extra/test/lit.cfg
index 5344e391e7e..bb592936e97 100644
--- a/clang-tools-extra/test/lit.cfg
+++ b/clang-tools-extra/test/lit.cfg
@@ -44,7 +44,7 @@ config.test_format = lit.formats.ShTest(execute_external)
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c', '.cpp', '.hpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s',
- '.modularize', '.module-map-checker']
+ '.modularize', '.module-map-checker', '.test']
# Test-time dependencies located in directories called 'Inputs' are excluded
# from test suites; there won't be any lit tests within them.
OpenPOWER on IntegriCloud