Files
swift-mirror/test/SourceKit/InterfaceGen/gen_module_group.swift
Jordan Rose d8d18d3e0b [SerializeDoc] Don't crash in module-merging with a group info file (#27867)
Group info works by matching source filenames with groups, but in
module merging the decls in the module no longer have associated
SourceFiles. Long-term, maybe we should switch this to working on
filenames directly (using the new support provided by swiftsourceinfo
files), but for now just don't crash.

rdar://problem/56592085
2019-10-24 15:52:25 -07:00

23 lines
1.3 KiB
Swift

// RUN: %empty-directory(%t.mod)
// RUN: %target-swift-frontend -module-name MyModule -emit-module -emit-module-path %t.mod/MyModule.swiftmodule -emit-module-doc -emit-module-doc-path %t.mod/MyModule.swiftdoc -group-info-path %S/Inputs/group.json %S/Inputs/swift_mod.swift %S/Inputs/swift_mod_syn.swift
// RUN: %sourcekitd-test -req=interface-gen -module MyModule -group-name A -- -I %t.mod -target %target-triple | %FileCheck -check-prefix=GROUPA %s
// RUN: %sourcekitd-test -req=interface-gen -module MyModule -group-name B -- -I %t.mod -target %target-triple | %FileCheck -check-prefix=GROUPB %s
// FIXME: We don't currently handle group info for multi-file builds,
// so just make sure we don't crash.
// RUN: %empty-directory(%t.multifrontend)
// RUN: %target-build-swift -module-name MyModule -emit-module -emit-module-path %t.multifrontend/MyModule.swiftmodule -Xfrontend -group-info-path -Xfrontend %S/Inputs/group.json %S/Inputs/swift_mod.swift %S/Inputs/swift_mod_syn.swift
// RUN: %sourcekitd-test -req=interface-gen -module MyModule -group-name A -- -I %t.multifrontend -target %target-triple | %FileCheck -check-prefix=EMPTY %s
// GROUPA: MyClass
// GROUPA-NOT: P1
// GROUPA-NOT: P2
// GROUPB: P1
// GROUPB: P2
// GROUPB-NOT: MyClass
// EMPTY-NOT: P1
// EMPTY-NOT: P2
// EMPTY-NOT: MyClass