Skip to content

Commit e2c28f5

Browse files
committed
Remove TestStandardTarget's default product type argument
This makes it more obvious that a test target is an app at first glance, and makes our test infrastructure slightly less Apple-centric by ceasing to encode an implicit assumption of a default app product type.
1 parent 52e4d9b commit e2c28f5

File tree

45 files changed

+280
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+280
-54
lines changed

Sources/SWBTestSupport/Projects/AppClips.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ extension TestProject {
5353
targets: [
5454
TestStandardTarget(
5555
"Foo",
56+
type: .application,
5657
buildConfigurations: [
5758
TestBuildConfiguration("Debug", buildSettings: appBuildSettings)
5859
],

Sources/SWBTestSupport/TestWorkspaces.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ package final class TestStandardTarget: TestInternalTarget, Sendable {
10721072
private let approvedByUser: Bool
10731073

10741074
/// Create a test target
1075-
package init(_ name: String, guid: String? = nil, type: TargetType = .application, buildConfigurations: [TestBuildConfiguration]? = nil, buildPhases: [any TestBuildPhase] = [], buildRules: [TestBuildRule] = [], customTasks: [TestCustomTask] = [], dependencies: [TestTargetDependency] = [], productReferenceName: String? = nil, predominantSourceCodeLanguage: SWBCore.StandardTarget.SourceCodeLanguage = .undefined, provisioningSourceData: [ProvisioningSourceData] = [], dynamicTargetVariantName: String? = nil, approvedByUser: Bool = true) {
1075+
package init(_ name: String, guid: String? = nil, type: TargetType, buildConfigurations: [TestBuildConfiguration]? = nil, buildPhases: [any TestBuildPhase] = [], buildRules: [TestBuildRule] = [], customTasks: [TestCustomTask] = [], dependencies: [TestTargetDependency] = [], productReferenceName: String? = nil, predominantSourceCodeLanguage: SWBCore.StandardTarget.SourceCodeLanguage = .undefined, provisioningSourceData: [ProvisioningSourceData] = [], dynamicTargetVariantName: String? = nil, approvedByUser: Bool = true) {
10761076
self.name = name
10771077
self.overriddenGuid = guid
10781078
self.type = type

Tests/SWBBuildSystemTests/BuildOperationTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ fileprivate struct BuildOperationTests: CoreBasedTests {
537537
]),
538538
TestStandardTarget(
539539
"agg3",
540+
type: .application,
540541
buildConfigurations: [
541542
TestBuildConfiguration("Debug", buildSettings: ["BUILD_VARIANTS": "normal debug"])
542543
],
@@ -3409,6 +3410,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
34093410
targets: [
34103411
TestStandardTarget(
34113412
"App",
3413+
type: .application,
34123414
buildPhases: [
34133415
TestSourcesBuildPhase([TestBuildFile("App.c")]),
34143416
]),
@@ -4398,6 +4400,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script
43984400
targets: [
43994401
TestStandardTarget(
44004402
"App",
4403+
type: .application,
44014404
buildPhases: [
44024405
TestSourcesBuildPhase([
44034406
"main.c",

Tests/SWBBuildSystemTests/EmbeddedBinaryValidationTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fileprivate struct EmbeddedBinaryValidationTests: CoreBasedTests {
4747
targets: [
4848
TestStandardTarget(
4949
"AppTarget",
50+
type: .application,
5051
buildPhases: [
5152
TestSourcesBuildPhase([
5253
"AppSource.m",

Tests/SWBBuildSystemTests/EntitlementsBuildOperationTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ fileprivate struct EntitlementsBuildOperationTests: CoreBasedTests {
411411
targets: [
412412
TestStandardTarget(
413413
"App",
414+
type: .application,
414415
buildPhases: [
415416
TestSourcesBuildPhase([
416417
"main.c",

Tests/SWBBuildSystemTests/HeadermapModuleCompatibilityTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ fileprivate struct HeadermapModuleCompatibilityTests: CoreBasedTests {
5151
targets: [
5252
TestStandardTarget(
5353
"Client-Default",
54+
type: .application,
5455
buildConfigurations: [
5556
// The default all-target-headers.hmap will make this setup fail.
5657
TestBuildConfiguration("Debug", buildSettings: [
@@ -66,6 +67,7 @@ fileprivate struct HeadermapModuleCompatibilityTests: CoreBasedTests {
6667
]),
6768
TestStandardTarget(
6869
"Client-UseVFS",
70+
type: .application,
6971
buildConfigurations: [
7072
// Forcing HEADERMAP_USES_VFS will turn off all-target-headers.hmap,
7173
// but its replacement all-non-framework-target-headers.hmap will
@@ -84,6 +86,7 @@ fileprivate struct HeadermapModuleCompatibilityTests: CoreBasedTests {
8486
]),
8587
TestStandardTarget(
8688
"Client-NoFrameworkEntries",
89+
type: .application,
8790
buildConfigurations: [
8891
// HEADERMAP_INCLUDES_FRAMEWORK_ENTRIES_FOR_TARGETS_NOT_BEING_BUILT
8992
// will neuter all-non-framework-target-headers.hmap enough that this

Tests/SWBBuildSystemTests/IndexBuildOperationTests.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
5252
targets: [
5353
TestStandardTarget(
5454
"AppTarget",
55+
type: .application,
5556
buildConfigurations: [
5657
TestBuildConfiguration("Debug"),
5758
],
@@ -264,6 +265,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
264265
try await withTemporaryDirectory { tmpDirPath in
265266
let appTarget = TestStandardTarget(
266267
"AppTarget",
268+
type: .application,
267269
buildConfigurations: [
268270
TestBuildConfiguration("Debug"),
269271
],
@@ -461,6 +463,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
461463
try await withTemporaryDirectory { tmpDirPath in
462464
let appTarget = TestStandardTarget(
463465
"AppTarget",
466+
type: .application,
464467
buildConfigurations: [
465468
TestBuildConfiguration("Debug", buildSettings: [
466469
"SDKROOT": "iphonesimulator",
@@ -544,6 +547,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
544547
try await withTemporaryDirectory { tmpDirPath in
545548
let appTarget = TestStandardTarget(
546549
"AppTarget",
550+
type: .application,
547551
buildConfigurations: [
548552
TestBuildConfiguration("Debug")
549553
],
@@ -641,6 +645,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
641645

642646
let macAppTarget = TestStandardTarget(
643647
"macAppTarget",
648+
type: .application,
644649
buildConfigurations: [
645650
TestBuildConfiguration("Debug", buildSettings: [
646651
"SDKROOT": "macosx",
@@ -659,6 +664,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
659664

660665
let iosAppTarget = TestStandardTarget(
661666
"iOSAppTarget",
667+
type: .application,
662668
buildConfigurations: [
663669
TestBuildConfiguration("Debug", buildSettings: [
664670
"SDKROOT": "iphonesimulator",
@@ -761,6 +767,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
761767
try await withTemporaryDirectory { tmpDirPath async throws -> Void in
762768
let appTarget1 = TestStandardTarget(
763769
"AppTarget1",
770+
type: .application,
764771
buildConfigurations: [
765772
TestBuildConfiguration("Debug", buildSettings: [
766773
"SDKROOT": "macosx",
@@ -782,6 +789,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
782789

783790
let appTarget2 = TestStandardTarget(
784791
"AppTarget2",
792+
type: .application,
785793
buildConfigurations: [
786794
TestBuildConfiguration("Debug", buildSettings: [
787795
"SDKROOT": "macosx",
@@ -1169,6 +1177,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
11691177
try await withTemporaryDirectory { tmpDirPath async throws -> Void in
11701178
let conflictTarget1 = TestStandardTarget(
11711179
"conflictApp",
1180+
type: .application,
11721181
buildConfigurations: [
11731182
TestBuildConfiguration("Debug", buildSettings: [
11741183
"SDKROOT": "macosx",
@@ -1184,6 +1193,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests {
11841193

11851194
let conflictTarget2 = TestStandardTarget(
11861195
"conflictApp",
1196+
type: .application,
11871197
buildConfigurations: [
11881198
TestBuildConfiguration("Debug", buildSettings: [
11891199
"SDKROOT": "macosx",

Tests/SWBBuildSystemTests/OnDemandResourcesTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
254254
targets: [
255255
TestStandardTarget(
256256
"App",
257+
type: .application,
257258
buildPhases: [
258259
TestResourcesBuildPhase([
259260
TestBuildFile("A.dat", assetTags: Set(["foo"])),
@@ -308,6 +309,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
308309
targets: [
309310
TestStandardTarget(
310311
"App",
312+
type: .application,
311313
buildPhases: [
312314
TestResourcesBuildPhase([
313315
TestBuildFile("A.dat", assetTags: Set(["foo"])),
@@ -382,6 +384,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
382384
targets: [
383385
TestStandardTarget(
384386
"App",
387+
type: .application,
385388
buildPhases: [
386389
TestResourcesBuildPhase([
387390
TestBuildFile("A.dat", assetTags: Set(["foo"])),
@@ -666,6 +669,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
666669
targets: [
667670
TestStandardTarget(
668671
"App",
672+
type: .application,
669673
buildPhases: [
670674
TestResourcesBuildPhase([
671675
TestBuildFile("A.dat", assetTags: Set(["foo"])),
@@ -811,6 +815,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
811815
targets: [
812816
TestStandardTarget(
813817
"App",
818+
type: .application,
814819
buildPhases: [
815820
TestResourcesBuildPhase([
816821
TestBuildFile("A.dat", assetTags: Set(["foo"])),
@@ -877,6 +882,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
877882
targets: [
878883
TestStandardTarget(
879884
"App",
885+
type: .application,
880886
buildPhases: [
881887
TestResourcesBuildPhase([
882888
TestBuildFile("AssetPackManifest.plist"),
@@ -944,6 +950,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
944950
targets: [
945951
TestStandardTarget(
946952
"App",
953+
type: .application,
947954
buildPhases: [
948955
TestResourcesBuildPhase([
949956
"Assets.xcassets",
@@ -1028,6 +1035,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests {
10281035
targets: [
10291036
TestStandardTarget(
10301037
"App",
1038+
type: .application,
10311039
buildPhases: [
10321040
TestResourcesBuildPhase([
10331041
TestBuildFile("A.dat", assetTags: Set(["foo"])),

Tests/SWBBuildSystemTests/SceneKitBuildOperationTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ fileprivate struct SceneKitBuildOperationTests: CoreBasedTests {
4141
]),
4242
],
4343
targets: [
44-
TestStandardTarget("App", buildPhases: [
44+
TestStandardTarget("App",
45+
type: .application,
46+
buildPhases: [
4547
TestResourcesBuildPhase([
4648
TestBuildFile("A.dae", decompress: false),
4749
TestBuildFile("B.dae", decompress: true),

Tests/SWBBuildSystemTests/ShellScriptSandboxingTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
347347
),
348348
TestStandardTarget(
349349
"TargetC",
350+
type: .application,
350351
buildPhases: [
351352
TestShellScriptBuildPhase(
352353
name: "TaskC",
@@ -371,6 +372,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
371372
),
372373
TestStandardTarget(
373374
"TargetB",
375+
type: .application,
374376
buildPhases: [
375377
TestShellScriptBuildPhase(
376378
name: "TaskB",
@@ -399,6 +401,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
399401
),
400402
TestStandardTarget(
401403
"TargetA",
404+
type: .application,
402405
buildPhases: [
403406
TestShellScriptBuildPhase(
404407
name: "TaskA",
@@ -567,6 +570,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
567570
),
568571
TestStandardTarget(
569572
"TargetC",
573+
type: .application,
570574
buildPhases: [
571575
TestShellScriptBuildPhase(
572576
name: "TaskC",
@@ -588,6 +592,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
588592
),
589593
TestStandardTarget(
590594
"TargetAB",
595+
type: .application,
591596
buildPhases: [
592597
TestShellScriptBuildPhase(
593598
name: "TaskAB",
@@ -861,6 +866,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
861866
),
862867
TestStandardTarget(
863868
"TargetC",
869+
type: .application,
864870
buildPhases: [
865871
TestShellScriptBuildPhase(
866872
name: "TaskC",
@@ -877,6 +883,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
877883
),
878884
TestStandardTarget(
879885
"TargetB",
886+
type: .application,
880887
buildPhases: [
881888
TestShellScriptBuildPhase(
882889
name: "TaskB",
@@ -973,6 +980,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
973980
),
974981
TestStandardTarget(
975982
"TargetB",
983+
type: .application,
976984
buildPhases: [
977985
TestShellScriptBuildPhase(
978986
name: "TaskB",
@@ -992,6 +1000,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
9921000
),
9931001
TestStandardTarget(
9941002
"TargetA",
1003+
type: .application,
9951004
buildPhases: [
9961005
TestShellScriptBuildPhase(
9971006
name: "TaskA",
@@ -1012,6 +1021,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
10121021
),
10131022
TestStandardTarget(
10141023
"TargetC",
1024+
type: .application,
10151025
buildPhases: [
10161026
TestShellScriptBuildPhase(
10171027
name: "TaskC",
@@ -1937,6 +1947,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests {
19371947
targets: [
19381948
TestStandardTarget(
19391949
"Calculate Checksum Target and a Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Long Description",
1950+
type: .application,
19401951
buildPhases: [
19411952
TestSourcesBuildPhase([
19421953
"raw.fake-neutral",

0 commit comments

Comments
 (0)