Skip to content

Commit 986fdc0

Browse files
committed
Add tests for product with missing modules
1 parent b5a418a commit 986fdc0

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public class Foo {
2+
var bar: Int = 0
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import PackageDescription
2+
3+
let package = Package(name: "Foo")
4+
5+
let archive = Product(name: "Bar", type: .Library(.Static), modules: "Foo", "Baz")
6+
7+
products.append(archive)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public class Foo {
2+
var bar: Int = 0
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import PackageDescription
2+
3+
let package = Package(name: "Foo")
4+
5+
let archive = Product(name: "Bar", type: .Library(.Dynamic), modules: "")
6+
7+
products.append(archive)

Tests/Functional/TestMiscellaneous.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,17 @@ class MiscellaneousTestCase: XCTestCase {
349349
XCTAssertFileExists(prefix, ".build/debug/libBar.a")
350350
}
351351
}
352+
353+
func testProductWithNoModules() {
354+
fixture(name: "Miscellaneous/ProductWithNoModules") { prefix in
355+
XCTAssertBuildFails(prefix)
356+
}
357+
}
358+
359+
func testProductWithMissingModules() {
360+
fixture(name: "Miscellaneous/ProductWithMissingModules") { prefix in
361+
XCTAssertBuilds(prefix)
362+
XCTAssertFileExists(prefix, ".build/debug/libBar.a")
363+
}
364+
}
352365
}

0 commit comments

Comments
 (0)