1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-build-swift %s -module-name SkipProtocolImplementations -emit-module -emit-module-path %t/
2
+ // RUN: %target-swift-frontend %s -module-name SkipProtocolImplementations -emit-module -emit-module-path %t/SkipProtocolImplementations.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ -skip-protocol-implementations
3
+ // RUN: %{python} -m json.tool %t/SkipProtocolImplementations.symbols.json %t/SkipProtocolImplementations.formatted.symbols.json
4
+ // RUN: %FileCheck %s --input-file %t/SkipProtocolImplementations.formatted.symbols.json
5
+
6
+ // RUN: %empty-directory(%t)
7
+ // RUN: %target-swift-frontend %s -module-name SkipProtocolImplementations -emit-module -emit-module-path %t/SkipProtocolImplementations.swiftmodule -emit-module-doc-path %t/SkipProtocolImplementations.swiftdoc
3
8
// RUN: %target-swift-symbolgraph-extract -module-name SkipProtocolImplementations -I %t -skip-protocol-implementations -pretty-print -output-dir %t
4
9
// RUN: %FileCheck %s --input-file %t/SkipProtocolImplementations.symbols.json
5
10
6
11
// make sure that using `-skip-protocol-implementations` removes the functions from `SomeProtocol` on `SomeStruct`
7
12
// CHECK-NOT: s:27SkipProtocolImplementations04SomeB0PAAE9bonusFuncyyF::SYNTHESIZED::s:27SkipProtocolImplementations10SomeStructV
8
13
// CHECK-NOT: s:27SkipProtocolImplementations10SomeStructV8someFuncyyF
9
14
10
- // the `-skip-protocol-implementations` code should drop any symbol that would get source-origin information
11
- // CHECK-NOT: sourceOrigin
15
+ // CHECK-LABEL: "symbols": [
16
+
17
+ // SomeStruct.otherFunc() should be present because it has its own doc comment
18
+ // CHECK: s:27SkipProtocolImplementations10SomeStructV9otherFuncyyF
19
+
20
+ // CHECK-LABEL: "relationships": [
12
21
13
- // however, we want to make sure that the conformance relationship itself stays
14
- // CHECK: conformsTo
22
+ // we want to make sure that the conformance relationship itself stays
23
+ // CHECK-DAG: conformsTo
24
+
25
+ // SomeStruct.otherFunc() should be the only one with sourceOrigin information
26
+ // CHECK-COUNT-1: sourceOrigin
15
27
16
28
public protocol SomeProtocol {
29
+ /// Base docs
17
30
func someFunc( )
31
+
32
+ /// Base docs
33
+ func otherFunc( )
18
34
}
19
35
20
36
public extension SomeProtocol {
@@ -23,4 +39,7 @@ public extension SomeProtocol {
23
39
24
40
public struct SomeStruct : SomeProtocol {
25
41
public func someFunc( ) { }
42
+
43
+ /// Local docs
44
+ public func otherFunc( ) { }
26
45
}
0 commit comments