Skip to content

Commit a01d30c

Browse files
committed
Re-enable testTargetBasedDependency.
1 parent b2f40e2 commit a01d30c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4067,14 +4067,17 @@ final class WorkspaceTests: XCTestCase {
40674067
}
40684068

40694069
func testTargetBasedDependency() throws {
4070+
let sandbox = AbsolutePath("/tmp/ws/")
4071+
let fs = InMemoryFileSystem()
4072+
4073+
let barProducts: [MockProduct]
40704074
#if ENABLE_TARGET_BASED_DEPENDENCY_RESOLUTION
4075+
barProducts = [MockProduct(name: "Bar", targets: ["Bar"]), MockProduct(name: "BarUnused", targets: ["BarUnused"])]
40714076
#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"])]
40734079
#endif
40744080

4075-
let sandbox = AbsolutePath("/tmp/ws/")
4076-
let fs = InMemoryFileSystem()
4077-
40784081
let workspace = try MockWorkspace(
40794082
sandbox: sandbox,
40804083
fs: fs,
@@ -4119,10 +4122,7 @@ final class WorkspaceTests: XCTestCase {
41194122
MockTarget(name: "BarUnused", dependencies: ["Biz"]),
41204123
MockTarget(name: "BarTests", dependencies: ["TestHelper2"], type: .test),
41214124
],
4122-
products: [
4123-
MockProduct(name: "Bar", targets: ["Bar"]),
4124-
MockProduct(name: "BarUnused", targets: ["BarUnused"]),
4125-
],
4125+
products: barProducts,
41264126
dependencies: [
41274127
MockDependency(name: "TestHelper2", requirement: .upToNextMajor(from: "1.0.0")),
41284128
MockDependency(name: "Biz", requirement: .upToNextMajor(from: "1.0.0")),

0 commit comments

Comments
 (0)