@@ -21,9 +21,9 @@ import SwiftBuildTestSupport
21
21
import SWBUtil
22
22
import SWBProtocol
23
23
24
- @Suite ( . requireDependencyScanner, . requireXcode16 ( ) )
24
+ @Suite ( . requireDependencyScanner)
25
25
fileprivate struct ClangExplicitModulesTests : CoreBasedTests {
26
- @Test ( . requireSDKs( . macOS ) )
26
+ @Test ( . requireSDKs( . host ) )
27
27
func explicitModulesBasic( ) async throws {
28
28
try await withTemporaryDirectory { tmpDirPath in
29
29
let testWorkspace = TestWorkspace (
@@ -63,7 +63,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
63
63
"""
64
64
}
65
65
66
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
66
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
67
67
let scanTask : Task = try results. checkTask ( . matchRuleType( " ScanDependencies " ) ) { $0 }
68
68
let compileTask : Task = try results. checkTask ( . matchRuleType( " CompileC " ) ) { $0 }
69
69
@@ -89,7 +89,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
89
89
"""
90
90
}
91
91
92
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
92
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
93
93
// the test stops at point of failure, so no additional failures are observed. behaves correctly
94
94
let scanTask : Task = try results. checkTask ( . matchRuleType( " ScanDependencies " ) ) { $0 }
95
95
let compileTask : Task = try results. checkTask ( . matchRuleType( " CompileC " ) ) { $0 }
@@ -105,7 +105,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
105
105
}
106
106
}
107
107
108
- @Test ( . requireSDKs( . macOS ) )
108
+ @Test ( . requireSDKs( . host ) )
109
109
func explicitModulesLibclangOpenFailure( ) async throws {
110
110
try await withTemporaryDirectory { tmpDirPath in
111
111
let testWorkspace = TestWorkspace (
@@ -146,14 +146,14 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
146
146
"""
147
147
}
148
148
149
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
149
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
150
150
results. checkError ( . and( . contains( " error scanning dependencies for source " ) , . contains( " could not load \( Path . null. str) " ) ) )
151
151
results. checkNoDiagnostics ( )
152
152
}
153
153
}
154
154
}
155
155
156
- @Test ( . requireSDKs( . macOS ) )
156
+ @Test ( . requireSDKs( . host ) )
157
157
func explicitModulesMultipleSources( ) async throws {
158
158
try await withTemporaryDirectory { tmpDirPath in
159
159
let testWorkspace = TestWorkspace (
@@ -202,7 +202,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
202
202
"""
203
203
}
204
204
205
- try await tester. checkBuild ( runDestination: . macOS ) { results in
205
+ try await tester. checkBuild ( runDestination: . host ) { results in
206
206
// There should only be 2 scanning actions.
207
207
results. checkTasks ( . matchRuleType( " ScanDependencies " ) ) { scanTasks in
208
208
#expect( scanTasks. count == 2 )
@@ -283,7 +283,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
283
283
}
284
284
}
285
285
286
- @Test ( . requireSDKs( . macOS ) )
286
+ @Test ( . requireSDKs( . host ) )
287
287
func explicitModulesWithPrecompiledHeader( ) async throws {
288
288
try await withTemporaryDirectory { tmpDirPath in
289
289
let testWorkspace = TestWorkspace (
@@ -353,7 +353,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
353
353
"""
354
354
}
355
355
356
- try await tester. checkBuild ( runDestination: . macOS ) { results in
356
+ try await tester. checkBuild ( runDestination: . host ) { results in
357
357
// There should be 2 scanning actions - one for the precompiled header, one for the translation unit.
358
358
results. checkTasks ( . matchRuleType( " ScanDependencies " ) ) { scanTasks in
359
359
#expect( scanTasks. count == 2 )
@@ -428,7 +428,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
428
428
}
429
429
}
430
430
431
- @Test ( . requireSDKs( . macOS ) )
431
+ @Test ( . requireSDKs( . host ) )
432
432
func explicitModulesWorkingDirectory( ) async throws {
433
433
try await withTemporaryDirectory { tmpDirPath in
434
434
let testWorkspace = TestWorkspace (
@@ -481,7 +481,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
481
481
"""
482
482
}
483
483
484
- try await tester. checkBuild ( runDestination: . macOS ) { results in
484
+ try await tester. checkBuild ( runDestination: . host ) { results in
485
485
// Check that the "Includes" header search path got picked up due to CompileC being executed in the project source directory.
486
486
results. checkNoDiagnostics ( )
487
487
}
@@ -596,7 +596,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
596
596
}
597
597
}
598
598
599
- @Test ( . requireSDKs( . macOS ) )
599
+ @Test ( . requireSDKs( . host ) )
600
600
func explicitModulesDriverExpandsToMultipleCC1s( ) async throws {
601
601
try await withTemporaryDirectory { tmpDirPath in
602
602
let testWorkspace = TestWorkspace (
@@ -654,7 +654,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
654
654
"""
655
655
}
656
656
657
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
657
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
658
658
results. checkTask ( . matchRuleType( " ScanDependencies " ) ) { _ in }
659
659
results. checkTask ( . matchRuleType( " PrecompileModule " ) ) { _ in }
660
660
var outputs = results. checkTask ( . matchRuleType( " CompileC " ) ) { task in
@@ -1074,7 +1074,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1074
1074
}
1075
1075
}
1076
1076
1077
- @Test ( . requireSDKs( . macOS ) )
1077
+ @Test ( . requireSDKs( . host ) )
1078
1078
func outputPath( ) async throws {
1079
1079
try await withTemporaryDirectory { tmpDir in
1080
1080
func outputPathTest( given outputPathBuildSetting: String ? , expected outputPath: Path , sourceLocation: SourceLocation = #_sourceLocation) async throws {
@@ -1119,7 +1119,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1119
1119
"""
1120
1120
}
1121
1121
1122
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
1122
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
1123
1123
1124
1124
results. checkNoErrors ( )
1125
1125
@@ -1146,12 +1146,10 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1146
1146
1147
1147
try await outputPathTest ( given: nil , expected: tmpDir. join ( " aProject/build/ExplicitPrecompiledModules " ) )
1148
1148
try await outputPathTest ( given: " $(SRCROOT)/Modules " , expected: tmpDir. join ( " aProject/Modules " ) )
1149
- try await outputPathTest ( given: " $(PER_ARCH_OBJECT_FILE_DIR)/Modules " , expected: tmpDir. join ( " aProject/build/aProject.build/Debug/Library.build/Objects-normal/x86_64/Modules " ) )
1150
- try await outputPathTest ( given: " $(BUILT_PRODUCTS_DIR)/Modules " , expected: tmpDir. join ( " aProject/build/Debug/Modules " ) )
1151
1149
}
1152
1150
}
1153
1151
1154
- @Test ( . requireSDKs( . macOS ) )
1152
+ @Test ( . requireSDKs( . host ) )
1155
1153
func explicitModulesSharingOfDependencies( ) async throws {
1156
1154
try await withTemporaryDirectory { tmpDirPath in
1157
1155
let testWorkspace = TestWorkspace (
@@ -1241,7 +1239,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1241
1239
1242
1240
let target_1 = try #require( tester. workspace. targets ( named: " Library_1 " ) . only)
1243
1241
let target_2 = try #require( tester. workspace. targets ( named: " Library_2 " ) . only)
1244
- try await tester. checkBuild ( runDestination: . macOS , buildRequest: BuildRequest ( parameters: parameters, buildTargets: [ . init( parameters: parameters, target: target_1) , . init( parameters: parameters, target: target_2) ] , continueBuildingAfterErrors: false , useParallelTargets: true , useImplicitDependencies: true , useDryRun: false ) ) { results in
1242
+ try await tester. checkBuild ( runDestination: . host , buildRequest: BuildRequest ( parameters: parameters, buildTargets: [ . init( parameters: parameters, target: target_1) , . init( parameters: parameters, target: target_2) ] , continueBuildingAfterErrors: false , useParallelTargets: true , useImplicitDependencies: true , useDryRun: false ) ) { results in
1245
1243
1246
1244
results. checkTasks ( . matchRuleType( " ScanDependencies " ) ) { scanTasks in
1247
1245
#expect( scanTasks. count == 2 )
@@ -1260,7 +1258,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1260
1258
}
1261
1259
1262
1260
let target_1_2 = try #require( tester. workspace. targets ( named: " Library_1_2 " ) . only)
1263
- try await tester. checkBuild ( runDestination: . macOS , buildRequest: BuildRequest ( parameters: parameters, buildTargets: [ . init( parameters: parameters, target: target_1_2) ] , continueBuildingAfterErrors: false , useParallelTargets: true , useImplicitDependencies: true , useDryRun: false ) ) { results in
1261
+ try await tester. checkBuild ( runDestination: . host , buildRequest: BuildRequest ( parameters: parameters, buildTargets: [ . init( parameters: parameters, target: target_1_2) ] , continueBuildingAfterErrors: false , useParallelTargets: true , useImplicitDependencies: true , useDryRun: false ) ) { results in
1264
1262
1265
1263
results. checkTasks ( . matchRuleType( " ScanDependencies " ) ) { scanTasks in
1266
1264
#expect( scanTasks. count == 2 )
@@ -1280,7 +1278,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1280
1278
}
1281
1279
}
1282
1280
1283
- @Test ( . requireSDKs( . macOS ) )
1281
+ @Test ( . requireSDKs( . host ) )
1284
1282
func sharingBetweenTargets( ) async throws {
1285
1283
1286
1284
try await withTemporaryDirectory { tmpDir in
@@ -1363,7 +1361,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1363
1361
let parameters = BuildParameters ( configuration: " Debug " )
1364
1362
let buildRequest = BuildRequest ( parameters: parameters, buildTargets: tester. workspace. projects [ 0 ] . targets. map ( { BuildRequest . BuildTargetInfo ( parameters: parameters, target: $0) } ) , continueBuildingAfterErrors: false , useParallelTargets: true , useImplicitDependencies: false , useDryRun: false )
1365
1363
1366
- try await tester. checkBuild ( runDestination: . macOS , buildRequest: buildRequest, persistent: true ) { results in
1364
+ try await tester. checkBuild ( runDestination: . host , buildRequest: buildRequest, persistent: true ) { results in
1367
1365
1368
1366
for targetName in [ " Library_1 " , " Library_2 " ] {
1369
1367
results. checkTaskExists ( . matchTargetName( targetName) , . matchRuleType( " ScanDependencies " ) )
@@ -1379,7 +1377,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1379
1377
}
1380
1378
}
1381
1379
1382
- @Test ( . requireSDKs( . macOS ) , . requireDependencyScanner, . requireDependencyScannerWorkingDirectoryOptimization)
1380
+ @Test ( . requireSDKs( . host ) , . requireDependencyScanner, . requireDependencyScannerWorkingDirectoryOptimization)
1383
1381
func sharingBetweenProjects( ) async throws {
1384
1382
try await withTemporaryDirectory { tmpDir in
1385
1383
let testWorkspace = TestWorkspace (
@@ -1469,7 +1467,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1469
1467
let parameters = BuildParameters ( configuration: " Debug " )
1470
1468
let buildRequest = BuildRequest ( parameters: parameters, buildTargets: tester. workspace. projects [ 0 ] . targets. map ( { BuildRequest . BuildTargetInfo ( parameters: parameters, target: $0) } ) + tester. workspace. projects [ 1 ] . targets. map ( { BuildRequest . BuildTargetInfo ( parameters: parameters, target: $0) } ) , continueBuildingAfterErrors: false , useParallelTargets: true , useImplicitDependencies: false , useDryRun: false )
1471
1469
1472
- try await tester. checkBuild ( runDestination: . macOS , buildRequest: buildRequest, persistent: true ) { results in
1470
+ try await tester. checkBuild ( runDestination: . host , buildRequest: buildRequest, persistent: true ) { results in
1473
1471
1474
1472
for targetName in [ " Library_1 " , " Library_2 " ] {
1475
1473
results. checkTaskExists ( . matchTargetName( targetName) , . matchRuleType( " ScanDependencies " ) )
@@ -1486,7 +1484,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1486
1484
}
1487
1485
}
1488
1486
1489
- @Test ( . requireSDKs( . macOS ) )
1487
+ @Test ( . requireSDKs( . host ) )
1490
1488
func incrementalBuildBasics( ) async throws {
1491
1489
try await withTemporaryDirectory { tmpDir in
1492
1490
let testWorkspace = TestWorkspace (
@@ -1527,7 +1525,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1527
1525
}
1528
1526
1529
1527
// Clean build
1530
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
1528
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
1531
1529
results. checkTaskExists ( . matchRuleType( " ScanDependencies " ) )
1532
1530
results. checkTaskExists ( . matchRuleType( " CompileC " ) )
1533
1531
@@ -1537,7 +1535,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1537
1535
}
1538
1536
1539
1537
// Null build
1540
- try await tester. checkNullBuild ( runDestination: . macOS , persistent: true )
1538
+ try await tester. checkNullBuild ( runDestination: . host , persistent: true )
1541
1539
1542
1540
// Touch the source file to trigger a new scan.
1543
1541
try await tester. fs. writeFileContents ( testWorkspace. sourceRoot. join ( " aProject/file.c " ) ) { stream in
@@ -1548,7 +1546,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1548
1546
"""
1549
1547
}
1550
1548
1551
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
1549
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
1552
1550
results. checkTaskExists ( . matchRuleType( " ScanDependencies " ) )
1553
1551
results. checkTaskExists ( . matchRuleType( " CompileC " ) )
1554
1552
@@ -1559,7 +1557,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1559
1557
}
1560
1558
}
1561
1559
1562
- @Test ( . requireSDKs( . macOS ) )
1560
+ @Test ( . requireSDKs( . host ) )
1563
1561
func incrementalTUChangeDoesNotForceModuleRebuilds( ) async throws {
1564
1562
try await withTemporaryDirectory { tmpDir in
1565
1563
let testWorkspace = TestWorkspace (
@@ -1600,7 +1598,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1600
1598
}
1601
1599
1602
1600
// Clean build
1603
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
1601
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
1604
1602
results. checkTaskExists ( . matchRuleType( " ScanDependencies " ) )
1605
1603
results. checkTaskExists ( . matchRuleType( " CompileC " ) )
1606
1604
results. checkTasks ( . matchRuleType( " PrecompileModule " ) ) { _ in }
@@ -1609,7 +1607,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1609
1607
}
1610
1608
1611
1609
// Null build
1612
- try await tester. checkNullBuild ( runDestination: . macOS , persistent: true )
1610
+ try await tester. checkNullBuild ( runDestination: . host , persistent: true )
1613
1611
1614
1612
// Touch the source file to trigger a new scan.
1615
1613
try await tester. fs. writeFileContents ( testWorkspace. sourceRoot. join ( " aProject/file.c " ) ) { stream in
@@ -1620,7 +1618,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
1620
1618
"""
1621
1619
}
1622
1620
1623
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
1621
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
1624
1622
results. checkTaskExists ( . matchRuleType( " ScanDependencies " ) )
1625
1623
results. checkTaskExists ( . matchRuleType( " CompileC " ) )
1626
1624
@@ -2785,7 +2783,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
2785
2783
}
2786
2784
}
2787
2785
2788
- @Test ( . requireSDKs( . macOS ) )
2786
+ @Test ( . requireSDKs( . host ) )
2789
2787
func explicitModulesWithResponseFiles( ) async throws {
2790
2788
try await withTemporaryDirectory { tmpDirPath in
2791
2789
let testWorkspace = TestWorkspace (
@@ -2826,7 +2824,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
2826
2824
"""
2827
2825
}
2828
2826
2829
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
2827
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
2830
2828
let responseFileTask : Task = try results. checkTask ( . matchRuleType( " WriteAuxiliaryFile " ) , . matchRuleItemPattern( . suffix( " .resp " ) ) ) { $0 }
2831
2829
let scanTask : Task = try results. checkTask ( . matchRuleType( " ScanDependencies " ) ) { $0 }
2832
2830
let compileTask : Task = try results. checkTask ( . matchRuleType( " CompileC " ) ) { $0 }
@@ -2837,7 +2835,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
2837
2835
}
2838
2836
}
2839
2837
2840
- @Test ( . requireSDKs( . macOS ) )
2838
+ @Test ( . requireSDKs( . host ) )
2841
2839
func disablement( ) async throws {
2842
2840
try await withTemporaryDirectory { tmpDir in
2843
2841
let testWorkspace = TestWorkspace (
@@ -2877,7 +2875,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
2877
2875
"""
2878
2876
}
2879
2877
2880
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
2878
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
2881
2879
results. checkNoTask ( . matchRuleType( " ScanDependencies " ) )
2882
2880
results. checkNoTask ( . matchRuleType( " PrecompileModule " ) )
2883
2881
@@ -3110,7 +3108,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
3110
3108
}
3111
3109
}
3112
3110
3113
- @Test ( . requireSDKs( . macOS ) )
3111
+ @Test ( . requireSDKs( . host ) )
3114
3112
func explicitModulesProducesCorrectDependencyInfoWhenPathContainsWhitespace( ) async throws {
3115
3113
try await withTemporaryDirectory { tmpDirParentPath in
3116
3114
let tmpDirPath = tmpDirParentPath. join ( " has whitespace " )
@@ -3153,7 +3151,7 @@ fileprivate struct ClangExplicitModulesTests: CoreBasedTests {
3153
3151
}
3154
3152
3155
3153
// The build should succeed if we produced dependency info which can be parsed correctly.
3156
- try await tester. checkBuild ( runDestination: . macOS , persistent: true ) { results in
3154
+ try await tester. checkBuild ( runDestination: . host , persistent: true ) { results in
3157
3155
results. checkNoDiagnostics ( )
3158
3156
}
3159
3157
}
0 commit comments