Skip to content

Commit 65ebb86

Browse files
committed
Test that static library products can be built
1 parent 287b954 commit 65ebb86

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-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")
6+
7+
products.append(archive)

Sources/Xcodeproj/TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ The following features are welcome, please submit a PR:
99
* Put dependencies in Package-named sub groups of a group called "Dependencies"
1010
* Add .txt etc. to groups
1111
* List modules in topological dependency order
12+
* Escape all strings

Tests/Functional/TestMiscellaneous.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,11 @@ class MiscellaneousTestCase: XCTestCase {
342342
XCTAssertEqual(output, "Goodbye\n")
343343
}
344344
}
345+
346+
func testStaticProduct() {
347+
fixture(name: "Miscellaneous/StaticProduct") { prefix in
348+
XCTAssertBuilds(prefix)
349+
XCTAssertFileExists(prefix, ".build/debug/libBar.a")
350+
}
351+
}
345352
}

Tests/Functional/Utilities.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ func executeSwiftBuild(chdir: String, configuration: Configuration = .Debug, pri
126126
if printIfError {
127127
print(out)
128128
print("SWIFT_EXEC:", env["SWIFT_EXEC"] ?? "nil")
129+
print("Using:", swiftBuildPath())
130+
print("SWIFT_BUILD_TOOL:", env["SWIFT_BUILD_TOOL"] ?? "nil")
129131
}
130132
throw error
131133
}

0 commit comments

Comments
 (0)