@@ -299,8 +299,8 @@ fileprivate struct UnitTestTaskConstructionTests: CoreBasedTests {
299299 }
300300 }
301301
302- @Test ( . requireSDKs( . linux ) )
303- func unitTestRunnerTarget_linux ( ) async throws {
302+ @Test ( . requireSDKs( . host ) , . skipHostOS ( . macOS ) )
303+ func unitTestRunnerTarget ( ) async throws {
304304 let swiftCompilerPath = try await self . swiftCompilerPath
305305 let swiftVersion = try await self . swiftVersion
306306 let testProject = TestProject (
@@ -317,43 +317,45 @@ fileprivate struct UnitTestTaskConstructionTests: CoreBasedTests {
317317 buildSettings: [
318318 " CODE_SIGN_IDENTITY " : " " ,
319319 " PRODUCT_NAME " : " $(TARGET_NAME) " ,
320- " SDKROOT " : " linux " ,
320+ " SDKROOT " : " auto " ,
321321 " SWIFT_VERSION " : swiftVersion,
322322 " INDEX_DATA_STORE_DIR " : " /index " ,
323- " LINKER_DRIVER " : " swiftc "
324- ] ) ,
323+ " LINKER_DRIVER " : " swiftc " ,
324+ ] )
325325 ] ,
326326 targets: [
327327 TestStandardTarget (
328328 " UnitTestRunner " ,
329329 type: . swiftpmTestRunner,
330330 buildConfigurations: [
331- TestBuildConfiguration ( " Debug " ,
332- buildSettings: [ : ] ) ,
331+ TestBuildConfiguration (
332+ " Debug " ,
333+ buildSettings: [ : ] )
333334 ] ,
334335 buildPhases: [
335336 TestSourcesBuildPhase ( ) ,
336337 TestFrameworksBuildPhase ( [
337- " UnitTestTarget.so "
338- ] )
338+ TestBuildFile ( . target ( " UnitTestTarget " ) )
339+ ] ) ,
339340 ] ,
340341 dependencies: [ " UnitTestTarget " ] ,
341342 ) ,
342343 TestStandardTarget (
343344 " UnitTestTarget " ,
344345 type: . unitTest,
345346 buildConfigurations: [
346- TestBuildConfiguration ( " Debug " ,
347- buildSettings: [ : ] ) ,
347+ TestBuildConfiguration (
348+ " Debug " ,
349+ buildSettings: [ : ] )
348350 ] ,
349351 buildPhases: [
350352 TestSourcesBuildPhase ( [
351353 " TestOne.swift " ,
352354 " TestTwo.swift " ,
353- ] ) ,
355+ ] )
354356 ] ,
355357 dependencies: [ ] ,
356- productReferenceName: " UnitTestTarget.so "
358+ productReferenceName: " $(EXCTABLE_NAME) "
357359 ) ,
358360 ] )
359361 let core = try await getCore ( )
@@ -363,15 +365,28 @@ fileprivate struct UnitTestTaskConstructionTests: CoreBasedTests {
363365
364366 try await fs. writeFileContents ( swiftCompilerPath) { $0 <<< " binary " }
365367
366- await tester. checkBuild ( runDestination: . linux , fs: fs) { results in
368+ await tester. checkBuild ( runDestination: . host , fs: fs) { results in
367369 results. checkTarget ( " UnitTestRunner " ) { target in
368370 results. checkTask ( . matchTarget( target) , . matchRuleType( " GenerateTestEntryPoint " ) ) { task in
369- task. checkCommandLineMatches ( [ . suffix( " builtin-generateTestEntryPoint " ) , " --output " , . suffix( " test_entry_point.swift " ) , " --discover-tests " , " --linker-file-list-format " , . any, " --index-store-library-path " , . suffix( " libIndexStore.so " ) , " --linker-filelist " , . suffix( " UnitTestTarget.LinkFileList " ) , " --index-store " , " /index " , " --index-unit-base-path " , " /tmp/Test/aProject/build " ] )
371+ task. checkCommandLineMatches ( [
372+ . suffix( " builtin-generateTestEntryPoint " ) ,
373+ " --output " ,
374+ . suffix( " test_entry_point.swift " ) ,
375+ " --discover-tests " ,
376+ " --linker-file-list-format " ,
377+ . any,
378+ " --index-store-library-path " ,
379+ . or( . suffix( " libIndexStore.so " ) , . suffix( " libIndexStore.dll " ) ) ,
380+ " --linker-filelist " , . suffix( " UnitTestTarget.LinkFileList " ) ,
381+ " --index-store " , . equal( Path ( " /index " ) . str) ,
382+ " --index-unit-base-path " ,
383+ . equal( Path . root. join ( " /tmp/Test/aProject/build " ) . str)
384+ ] )
370385 task. checkInputs ( [
371386 . pathPattern( . suffix( " UnitTestTarget.LinkFileList " ) ) ,
372- . pathPattern( . suffix( " UnitTestTarget.so " ) ) ,
387+ . pathPattern( . or( . suffix( " UnitTestTarget.so " ) , . suffix( " UnitTestTarget.dll " ) ) ) ,
388+ . namePattern( . any) ,
373389 . namePattern( . any) ,
374- . namePattern( . any)
375390 ] )
376391 task. checkOutputs ( [ . pathPattern( . suffix( " test_entry_point.swift " ) ) ] )
377392 }
0 commit comments