File tree Expand file tree Collapse file tree 5 files changed +55
-1
lines changed
resources/merge/non-overlapping Expand file tree Collapse file tree 5 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ internal class KlibAbiDumpMerger {
254254 // then try to parse a manifest
255255 while (hasNext()) {
256256 val next = peek()!!
257- if (! next.startsWith(COMMENT_PREFIX )) break
257+ if (! next.startsWith(COMMENT_PREFIX ) || next.startsWith( TARGETS_LIST_PREFIX ) ) break
258258 next()
259259 // There's no manifest in merged files
260260 check(! isMergedFile) { " Unexpected header line: $next " }
Original file line number Diff line number Diff line change @@ -336,4 +336,28 @@ class KlibAbiMergingTest {
336336 KlibAbiDumpMerger ().merge(file(" /merge/stdlib_native_common.abi" ), " target" )
337337 }
338338 }
339+
340+ @Test
341+ fun mergeDumpsWithNonOverlappingDeclarations () {
342+ val dump = dumpToFile(KlibAbiDumpMerger ().apply {
343+ merge(file(" /merge/non-overlapping/linux-arm64.klib.abi" ))
344+ merge(file(" /merge/non-overlapping/linux-x64.klib.abi" ))
345+ })
346+
347+ assertContentEquals(
348+ lines(" /merge/non-overlapping/merged.klib.abi" ),
349+ Files .readAllLines(dump.toPath()).asSequence()
350+ )
351+ }
352+
353+ @Test
354+ fun loadMergedDumpWithNonOverlappingDeclarations () {
355+ val dump = dumpToFile(KlibAbiDumpMerger ().apply {
356+ merge(file(" /merge/non-overlapping/merged.klib.abi" ))
357+ })
358+ assertContentEquals(
359+ lines(" /merge/non-overlapping/merged.klib.abi" ),
360+ Files .readAllLines(dump.toPath()).asSequence()
361+ )
362+ }
339363}
Original file line number Diff line number Diff line change 1+ // Klib ABI Dump
2+ // Targets: [linuxArm64]
3+ // Rendering settings:
4+ // - Signature version: 2
5+ // - Show manifest properties: false
6+ // - Show declarations: true
7+
8+ // Library unique name: <org.example:bcv-klib-test>
9+ final fun org.example/add(kotlin/Long, kotlin/Long): kotlin/Long // org.example/add|add(kotlin.Long;kotlin.Long){}[0]
Original file line number Diff line number Diff line change 1+ // Klib ABI Dump
2+ // Targets: [linuxX64]
3+ // Rendering settings:
4+ // - Signature version: 2
5+ // - Show manifest properties: false
6+ // - Show declarations: true
7+
8+ // Library unique name: <org.example:bcv-klib-test>
9+ final fun org.example/sub(kotlin/Long, kotlin/Long): kotlin/Long // org.example/sub|sub(kotlin.Long;kotlin.Long){}[0]
Original file line number Diff line number Diff line change 1+ // Klib ABI Dump
2+ // Targets: [linuxArm64, linuxX64]
3+ // Rendering settings:
4+ // - Signature version: 2
5+ // - Show manifest properties: false
6+ // - Show declarations: true
7+
8+ // Library unique name: <org.example:bcv-klib-test>
9+ // Targets: [linuxArm64]
10+ final fun org.example/add(kotlin/Long, kotlin/Long): kotlin/Long // org.example/add|add(kotlin.Long;kotlin.Long){}[0]
11+ // Targets: [linuxX64]
12+ final fun org.example/sub(kotlin/Long, kotlin/Long): kotlin/Long // org.example/sub|sub(kotlin.Long;kotlin.Long){}[0]
You can’t perform that action at this time.
0 commit comments