From 229c63b02127e0168da02f0214dd4f35220499ee Mon Sep 17 00:00:00 2001 From: Julie Hockett Date: Tue, 16 Oct 2018 23:07:37 +0000 Subject: [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 --- clang-tools-extra/test/clang-doc/single-file.cpp | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 clang-tools-extra/test/clang-doc/single-file.cpp (limited to 'clang-tools-extra/test/clang-doc/single-file.cpp') diff --git a/clang-tools-extra/test/clang-doc/single-file.cpp b/clang-tools-extra/test/clang-doc/single-file.cpp new file mode 100644 index 00000000000..c03481d4d21 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/single-file.cpp @@ -0,0 +1,31 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" +// RUN: clang-doc --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: cat %t/docs/GlobalNamespace.yaml | FileCheck %s --check-prefix=CHECK +// RUN: rm -rf %t + +void function(int x); + +void function(int x) {} + +// 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: 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' +// CHECK-NEXT: DefLocation: +// CHECK-NEXT: LineNumber: [[@LINE-8]] +// CHECK-NEXT: Filename: '{{.*}} +// CHECK-NEXT: Location: +// CHECK-NEXT: - LineNumber: [[@LINE-13]] +// CHECK-NEXT: Filename: '{{.*}}' +// CHECK-NEXT: Params: +// CHECK-NEXT: - Type: +// CHECK-NEXT: Name: 'int' +// CHECK-NEXT: Name: 'x' +// CHECK-NEXT: ReturnType: +// CHECK-NEXT: Type: +// CHECK-NEXT: Name: 'void' +// CHECK-NEXT:... -- cgit v1.2.3