summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-doc/single-file-public.cpp
diff options
context:
space:
mode:
authorJulie Hockett <juliehockett@google.com>2018-10-16 23:07:37 +0000
committerJulie Hockett <juliehockett@google.com>2018-10-16 23:07:37 +0000
commit229c63b02127e0168da02f0214dd4f35220499ee (patch)
tree812c3445f7d8119eb4447a9c10b3aad0fada0a7c /clang-tools-extra/test/clang-doc/single-file-public.cpp
parent7f87ca62a27e724a99a3b1ea5933ea62f98b959f (diff)
downloadbcm5719-llvm-229c63b02127e0168da02f0214dd4f35220499ee.tar.gz
bcm5719-llvm-229c63b02127e0168da02f0214dd4f35220499ee.zip
[clang-doc] Limit integration tests
Now that the clang-doc libraries are covered by unit tests, we don't need to have extensive (and unmaintainable) integration tests. This replaces the integration test suite with a smaller one that just tests the tool itself and removes extraneous dumping logic from the tool itself. Includes tests that cover the parse->serialize->merge->generate pipeline, as well as tests for the --public, --format, --doxygen, and --output flags. Differential Revision: https://reviews.llvm.org/D53150 llvm-svn: 344655
Diffstat (limited to 'clang-tools-extra/test/clang-doc/single-file-public.cpp')
-rw-r--r--clang-tools-extra/test/clang-doc/single-file-public.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-doc/single-file-public.cpp b/clang-tools-extra/test/clang-doc/single-file-public.cpp
new file mode 100644
index 00000000000..f9a3bbf7942
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/single-file-public.cpp
@@ -0,0 +1,49 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo "" > %t/compile_flags.txt
+// RUN: cp "%s" "%t/test.cpp"
+// RUN: clang-doc --doxygen --public -p %t %t/test.cpp -output=%t/docs
+// RUN: cat %t/docs/Record.yaml | FileCheck %s --check-prefix=CHECK
+// RUN: rm -rf %t
+
+class Record {
+private:
+ void function_private();
+
+public:
+ void function_public();
+};
+
+void Record::function_private() {}
+
+void Record::function_public() {}
+
+// CHECK: ---
+// CHECK-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-NEXT: Name: 'Record'
+// CHECK-NEXT: DefLocation:
+// CHECK-NEXT: LineNumber: [[@LINE-16]]
+// CHECK-NEXT: Filename: '{{.*}}'
+// CHECK-NEXT: TagType: Class
+// CHECK-NEXT: ChildFunctions:
+// CHECK-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-NEXT: Name: 'function_public'
+// CHECK-NEXT: Namespace:
+// CHECK-NEXT: - Type: Record
+// CHECK-NEXT: Name: 'Record'
+// CHECK-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-NEXT: DefLocation:
+// CHECK-NEXT: LineNumber: [[@LINE-17]]
+// CHECK-NEXT: Filename: '{{.*}}'
+// CHECK-NEXT: Location:
+// CHECK-NEXT: - LineNumber: [[@LINE-25]]
+// CHECK-NEXT: Filename: '{{.*}}'
+// CHECK-NEXT: IsMethod: true
+// CHECK-NEXT: Parent:
+// CHECK-NEXT: Type: Record
+// CHECK-NEXT: Name: 'Record'
+// CHECK-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'
+// CHECK-NEXT: ReturnType:
+// CHECK-NEXT: Type:
+// CHECK-NEXT: Name: 'void'
+// CHECK-NEXT: ...
OpenPOWER on IntegriCloud