mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Update Driver to generate package interface only if package-name is passed
Resolves rdar://119275771
This commit is contained in:
38
test/ModuleInterface/package_interface_conditional_gen.swift
Normal file
38
test/ModuleInterface/package_interface_conditional_gen.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: split-file %s %t
|
||||
|
||||
/// A package swiftinterface should be generated only if -package-name is passed.
|
||||
// RUN: %target-build-swift -emit-module %t/Bar.swift -I %t \
|
||||
// RUN: -module-name Bar -package-name foopkg \
|
||||
// RUN: -enable-library-evolution -swift-version 5 \
|
||||
// RUN: -emit-module-interface-path %t/Bar.swiftinterface \
|
||||
// RUN: -emit-package-module-interface-path %t/Bar.package.swiftinterface
|
||||
|
||||
// RUN: %FileCheck %s < %t/Bar.package.swiftinterface
|
||||
// CHECK: -package-name foopkg
|
||||
// CHECK: public struct PubStruct
|
||||
// CHECK: package struct PkgStruct
|
||||
|
||||
/// If -package-name is not passed, a package interface should not be generated even if
|
||||
/// `-emit-package-module-interface-path` is passed.
|
||||
// RUN: %target-build-swift -emit-module %t/Baz.swift -I %t \
|
||||
// RUN: -module-name Baz \
|
||||
// RUN: -enable-library-evolution -swift-version 5 \
|
||||
// RUN: -emit-module-interface-path %t/Baz.swiftinterface \
|
||||
// RUN: -emit-package-module-interface-path %t/Baz.package.swiftinterface
|
||||
|
||||
// RUN: ls %t | not grep "Baz.package.swiftinterface"
|
||||
|
||||
//--- Bar.swift
|
||||
public struct PubStruct {
|
||||
|
||||
}
|
||||
|
||||
package struct PkgStruct {
|
||||
|
||||
}
|
||||
|
||||
//--- Baz.swift
|
||||
public struct PubStruct {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user