Skip to content

Commit e02f8dc

Browse files
committed
[PkgConfig] Add test case for dummy dependency
1 parent e1f65d5 commit e02f8dc

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Tests/PackageLoadingTests/PkgConfigParserTests.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ final class PkgConfigParserTests: XCTestCase {
105105
}
106106
}
107107

108+
func testDummyDependency() {
109+
try! loadPCFile("dummy_dependency.pc") { parser in
110+
XCTAssertEqual(parser.variables, [
111+
"prefix": "/usr/local/bin",
112+
"exec_prefix": "/usr/local/bin",
113+
"pcfiledir": parser.pcFile.parentDirectory.pathString,
114+
"pc_sysrootdir": AbsolutePath.root.pathString
115+
])
116+
XCTAssertEqual(parser.dependencies, ["pango", "fontconfig"])
117+
XCTAssertEqual(parser.cFlags, [])
118+
XCTAssertEqual(parser.libs, ["-L/usr/local/bin", "-lpangoft2-1.0"])
119+
}
120+
}
121+
108122
/// Test custom search path get higher priority for locating pc files.
109123
func testCustomPcFileSearchPath() throws {
110124
let observability = ObservabilitySystem.makeForTesting()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
prefix=/usr/local/bin
2+
exec_prefix=${prefix}
3+
4+
#some comment
5+
6+
Requires: pango, , fontconfig >= 2.13.0
7+
Libs:-L${prefix} -lpangoft2-1.0

0 commit comments

Comments
 (0)