Skip to content

Commit c91181b

Browse files
committed
[PkgConfig] add tests to ensure that it handles correctly circular deps
1 parent 7600334 commit c91181b

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

Tests/TSCUtilityTests/PkgConfigParserTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ import TSCTestSupport
1515
@testable import TSCUtility
1616

1717
final class PkgConfigParserTests: XCTestCase {
18+
func testCircularPCFile() throws {
19+
XCTAssertTrue(try PkgConfig(name: "harfbuzz", additionalSearchPaths: [pcFilePath("harfbuzz.pc")], diagnostics: DiagnosticsEngine(), brewPrefix: nil).diagnostics.diagnostics.contains { diagnostic in
20+
diagnostic.message.text == "circular dependency detected while parsing harfbuzz: harfbuzz -> freetype2 -> harfbuzz"
21+
})
22+
}
1823

1924
func testGTK3PCFile() {
2025
try! loadPCFile("gtk+-3.0.pc") { parser in
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
prefix=/usr
2+
exec_prefix=/usr
3+
libdir=/usr/lib
4+
includedir=/usr/include
5+
6+
Name: FreeType 2
7+
URL: https://freetype.org
8+
Description: A free, high-quality, and portable font engine.
9+
Version: 23.4.17
10+
Requires:
11+
Requires.private: zlib, libpng, harfbuzz >= 1.8.0
12+
Libs: -L${libdir} -lfreetype
13+
Libs.private: -lbz2
14+
Cflags: -I${includedir}/freetype2
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=/usr
2+
libdir=${prefix}/lib
3+
includedir=${prefix}/include
4+
5+
Name: harfbuzz
6+
Description: HarfBuzz text shaping library
7+
Version: 2.7.4
8+
Requires.private: freetype2, graphite2, glib-2.0
9+
Libs: -L${libdir} -lharfbuzz
10+
Libs.private: -pthread -lm
11+
Cflags: -I${includedir}/harfbuzz

0 commit comments

Comments
 (0)