11// 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
38// RUN: %target-swift-symbolgraph-extract -module-name SkipProtocolImplementations -I %t -skip-protocol-implementations -pretty-print -output-dir %t
49// RUN: %FileCheck %s --input-file %t/SkipProtocolImplementations.symbols.json
510
611// make sure that using `-skip-protocol-implementations` removes the functions from `SomeProtocol` on `SomeStruct`
712// CHECK-NOT: s:27SkipProtocolImplementations04SomeB0PAAE9bonusFuncyyF::SYNTHESIZED::s:27SkipProtocolImplementations10SomeStructV
813// CHECK-NOT: s:27SkipProtocolImplementations10SomeStructV8someFuncyyF
914
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": [
1221
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
1527
1628public protocol SomeProtocol {
29+ /// Base docs
1730 func someFunc( )
31+
32+ /// Base docs
33+ func otherFunc( )
1834}
1935
2036public extension SomeProtocol {
@@ -23,4 +39,7 @@ public extension SomeProtocol {
2339
2440public struct SomeStruct : SomeProtocol {
2541 public func someFunc( ) { }
42+
43+ /// Local docs
44+ public func otherFunc( ) { }
2645}
0 commit comments