Skip to content

Commit

Permalink
[PkgConfig] Add test case for dummy dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Aug 22, 2022
1 parent e1f65d5 commit e02f8dc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Tests/PackageLoadingTests/PkgConfigParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ final class PkgConfigParserTests: XCTestCase {
}
}

func testDummyDependency() {
try! loadPCFile("dummy_dependency.pc") { parser in
XCTAssertEqual(parser.variables, [
"prefix": "/usr/local/bin",
"exec_prefix": "/usr/local/bin",
"pcfiledir": parser.pcFile.parentDirectory.pathString,
"pc_sysrootdir": AbsolutePath.root.pathString
])
XCTAssertEqual(parser.dependencies, ["pango", "fontconfig"])
XCTAssertEqual(parser.cFlags, [])
XCTAssertEqual(parser.libs, ["-L/usr/local/bin", "-lpangoft2-1.0"])
}
}

/// Test custom search path get higher priority for locating pc files.
func testCustomPcFileSearchPath() throws {
let observability = ObservabilitySystem.makeForTesting()
Expand Down
7 changes: 7 additions & 0 deletions Tests/PackageLoadingTests/pkgconfigInputs/dummy_dependency.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
prefix=/usr/local/bin
exec_prefix=${prefix}

#some comment

Requires: pango, , fontconfig >= 2.13.0
Libs:-L${prefix} -lpangoft2-1.0

0 comments on commit e02f8dc

Please sign in to comment.