@@ -30,23 +30,25 @@ fileprivate struct ObjectLibraryTaskConstructionTests: CoreBasedTests {
3030 TestFile ( " b.c " ) ,
3131 ] ) ,
3232 buildConfigurations: [
33- TestBuildConfiguration ( " Debug " , buildSettings: [
34- " PRODUCT_NAME " : " $(TARGET_NAME) " ,
35- " SWIFT_EXEC " : try await swiftCompilerPath. str,
36- " SWIFT_VERSION " : try await swiftVersion
37- ] ) ,
33+ TestBuildConfiguration (
34+ " Debug " ,
35+ buildSettings: [
36+ " PRODUCT_NAME " : " $(TARGET_NAME) " ,
37+ " SWIFT_EXEC " : try await swiftCompilerPath. str,
38+ " SWIFT_VERSION " : try await swiftVersion,
39+ ] )
3840 ] ,
3941 targets: [
4042 TestStandardTarget (
4143 " Library " ,
4244 type: . objectLibrary,
4345 buildConfigurations: [
44- TestBuildConfiguration ( " Debug " , buildSettings: [ : ] ) ,
46+ TestBuildConfiguration ( " Debug " , buildSettings: [ : ] )
4547 ] ,
4648 buildPhases: [
47- TestSourcesBuildPhase ( [ " a.c " , " b.c " ] ) ,
49+ TestSourcesBuildPhase ( [ " a.c " , " b.c " ] )
4850 ]
49- ) ,
51+ )
5052 ] )
5153 let core = try await getCore ( )
5254 let tester = try TaskConstructionTester ( core, testProject)
@@ -61,7 +63,7 @@ fileprivate struct ObjectLibraryTaskConstructionTests: CoreBasedTests {
6163 . suffix( " a.o " ) ,
6264 . suffix( " b.o " ) ,
6365 " --output " ,
64- . suffix( " Library.objlib " )
66+ . suffix( " Library.objlib " ) ,
6567 ] )
6668 task. checkInputs ( [
6769 . pathPattern( . suffix( " a.o " ) ) ,
@@ -76,6 +78,63 @@ fileprivate struct ObjectLibraryTaskConstructionTests: CoreBasedTests {
7678 }
7779 }
7880
81+ @Test (
82+ . requireSDKs( . host) ,
83+ arguments: [
84+ true ,
85+ false ,
86+ ] ,
87+ )
88+ func objectLibraryDoesNotProductStipTaskWhenBinaryStripInstalledProductSetOrUnset(
89+ isStrippingEnabled: Bool ,
90+ ) async throws {
91+ let buildConfiguration = " Debug "
92+ let testProject = TestProject (
93+ " aProject " ,
94+ groupTree: TestGroup (
95+ " SomeFiles " ,
96+ children: [
97+ TestFile ( " a.c " ) ,
98+ TestFile ( " b.c " ) ,
99+ ] ,
100+ ) ,
101+ buildConfigurations: [
102+ TestBuildConfiguration (
103+ buildConfiguration,
104+ buildSettings: [
105+ " PRODUCT_NAME " : " $(TARGET_NAME) " ,
106+ " SWIFT_EXEC " : try await swiftCompilerPath. str,
107+ " SWIFT_VERSION " : try await swiftVersion,
108+ " DEPLOYMENT_POSTPROCESSING " : " YES " ,
109+ " STRIP_INSTALLED_PRODUCT " : ( isStrippingEnabled ? " YES " : " NO " ) ,
110+ ] ,
111+ ) ,
112+ ] ,
113+ targets: [
114+ TestStandardTarget (
115+ " Library " ,
116+ type: . objectLibrary,
117+ buildConfigurations: [
118+ TestBuildConfiguration ( buildConfiguration, buildSettings: [ : ] ) ,
119+ ] ,
120+ buildPhases: [
121+ TestSourcesBuildPhase ( [ " a.c " , " b.c " ] ) ,
122+ ] ,
123+ ) ,
124+ ] ,
125+ )
126+ let core = try await getCore ( )
127+ let tester : TaskConstructionTester = try TaskConstructionTester ( core, testProject)
128+
129+ await tester. checkBuild (
130+ BuildParameters ( configuration: buildConfiguration, overrides: [ : ] ) ,
131+ runDestination: . host
132+ ) { results in
133+ results. checkNoDiagnostics ( )
134+ results. checkNoTask ( . matchRuleType( " Strip " ) )
135+ }
136+ }
137+
79138 @Test ( . requireSDKs( . host) )
80139 func objectLibraryConsumer( ) async throws {
81140 let testWorkspace = TestWorkspace (
@@ -96,32 +155,32 @@ fileprivate struct ObjectLibraryTaskConstructionTests: CoreBasedTests {
96155 " CODE_SIGNING_ALLOWED " : " NO " ,
97156 " PRODUCT_NAME " : " $(TARGET_NAME) " ,
98157 " SWIFT_VERSION " : try await swiftVersion,
99- " SWIFT_EXEC " : try await swiftCompilerPath. str
100- ] ) ,
158+ " SWIFT_EXEC " : try await swiftCompilerPath. str,
159+ ] )
101160 ] ,
102161 targets: [
103162 TestStandardTarget (
104163 " Tool " ,
105164 type: . commandLineTool,
106165 buildPhases: [
107166 TestSourcesBuildPhase ( [
108- " b.swift " ,
167+ " b.swift "
109168 ] ) ,
110169 TestFrameworksBuildPhase ( [
111170 " Library.objlib "
112- ] )
171+ ] ) ,
113172 ] ,
114173 dependencies: [
115- " Library " ,
174+ " Library "
116175 ]
117176 ) ,
118177 TestStandardTarget (
119178 " Library " ,
120179 type: . objectLibrary,
121180 buildPhases: [
122181 TestSourcesBuildPhase ( [
123- " a.swift " ,
124- ] ) ,
182+ " a.swift "
183+ ] )
125184 ]
126185 ) ,
127186 ] )
@@ -148,7 +207,7 @@ fileprivate struct ObjectLibraryTaskConstructionTests: CoreBasedTests {
148207 groupTree: TestGroup (
149208 " Sources " ,
150209 children: [
151- TestFile ( " a.swift " ) ,
210+ TestFile ( " a.swift " )
152211 ] ) ,
153212 buildConfigurations: [
154213 TestBuildConfiguration (
@@ -157,8 +216,8 @@ fileprivate struct ObjectLibraryTaskConstructionTests: CoreBasedTests {
157216 " CODE_SIGNING_ALLOWED " : " NO " ,
158217 " PRODUCT_NAME " : " $(TARGET_NAME) " ,
159218 " SWIFT_VERSION " : try await swiftVersion,
160- " SWIFT_EXEC " : try await swiftCompilerPath. str
161- ] ) ,
219+ " SWIFT_EXEC " : try await swiftCompilerPath. str,
220+ ] )
162221 ] ,
163222 targets: [
164223 TestStandardTarget (
@@ -174,16 +233,16 @@ fileprivate struct ObjectLibraryTaskConstructionTests: CoreBasedTests {
174233 TestSourcesBuildPhase ( [ ] ) ,
175234 ] ,
176235 dependencies: [
177- " Library " ,
236+ " Library "
178237 ]
179238 ) ,
180239 TestStandardTarget (
181240 " Library " ,
182241 type: . objectLibrary,
183242 buildPhases: [
184243 TestSourcesBuildPhase ( [
185- " a.swift " ,
186- ] ) ,
244+ " a.swift "
245+ ] )
187246 ]
188247 ) ,
189248 ] )
0 commit comments