@@ -4067,14 +4067,17 @@ final class WorkspaceTests: XCTestCase {
4067
4067
}
4068
4068
4069
4069
func testTargetBasedDependency( ) throws {
4070
+ let sandbox = AbsolutePath ( " /tmp/ws/ " )
4071
+ let fs = InMemoryFileSystem ( )
4072
+
4073
+ let barProducts : [ MockProduct ]
4070
4074
#if ENABLE_TARGET_BASED_DEPENDENCY_RESOLUTION
4075
+ barProducts = [ MockProduct ( name: " Bar " , targets: [ " Bar " ] ) , MockProduct ( name: " BarUnused " , targets: [ " BarUnused " ] ) ]
4071
4076
#else
4072
- try XCTSkipIf ( true )
4077
+ // Whether a product is being used does not affect dependency resolution in this case, so we omit the unused product.
4078
+ barProducts = [ MockProduct ( name: " Bar " , targets: [ " Bar " ] ) ]
4073
4079
#endif
4074
4080
4075
- let sandbox = AbsolutePath ( " /tmp/ws/ " )
4076
- let fs = InMemoryFileSystem ( )
4077
-
4078
4081
let workspace = try MockWorkspace (
4079
4082
sandbox: sandbox,
4080
4083
fs: fs,
@@ -4119,10 +4122,7 @@ final class WorkspaceTests: XCTestCase {
4119
4122
MockTarget ( name: " BarUnused " , dependencies: [ " Biz " ] ) ,
4120
4123
MockTarget ( name: " BarTests " , dependencies: [ " TestHelper2 " ] , type: . test) ,
4121
4124
] ,
4122
- products: [
4123
- MockProduct ( name: " Bar " , targets: [ " Bar " ] ) ,
4124
- MockProduct ( name: " BarUnused " , targets: [ " BarUnused " ] ) ,
4125
- ] ,
4125
+ products: barProducts,
4126
4126
dependencies: [
4127
4127
MockDependency ( name: " TestHelper2 " , requirement: . upToNextMajor( from: " 1.0.0 " ) ) ,
4128
4128
MockDependency ( name: " Biz " , requirement: . upToNextMajor( from: " 1.0.0 " ) ) ,
0 commit comments