Skip to content

Commit 01972fc

Browse files
committed
Use LCOV exclusion markers for coverage filter
1 parent 9b8ff2a commit 01972fc

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/scripts/filter_lcov.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ def ignored_lines_for(source_path)
1212
File.readlines(source_path).each_with_index do |line, index|
1313
line_number = index + 1
1414

15-
if line.include?("coverage:ignore-line")
15+
if line.include?("coverage:ignore-line") || line.include?("LCOV_EXCL_LINE")
1616
ignored << line_number
1717
next
1818
end
1919

20-
if line.include?("coverage:ignore-start")
20+
if line.include?("coverage:ignore-start") || line.include?("LCOV_EXCL_START")
2121
active = true
2222
ignored << line_number
2323
next
2424
end
2525

2626
ignored << line_number if active
2727

28-
active = false if line.include?("coverage:ignore-end")
28+
active = false if line.include?("coverage:ignore-end") || line.include?("LCOV_EXCL_STOP")
2929
end
3030

3131
ignored

Sources/SwiftNEW/Styles/MeshView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ struct MeshView: View {
1414
#if compiler(>=6.0)
1515
if #available(iOS 18.0, macOS 15.0, visionOS 2.0, tvOS 18.0, *) {
1616
meshGradient
17-
} else { // coverage:ignore-start -- Xcode 26 coverage runner cannot execute older OS mesh fallback.
17+
} else { // LCOV_EXCL_START -- Xcode 26 coverage runner cannot execute older OS mesh fallback.
1818
fallbackGradient
19-
} // coverage:ignore-end
19+
} // LCOV_EXCL_STOP
2020
#else
2121
fallbackGradient
2222
#endif

Sources/SwiftNEW/Views/SwiftNEW+View.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private struct SheetBackdropModifier: ViewModifier {
151151
} else {
152152
content.presentationBackground(.thinMaterial)
153153
}
154-
} else { // coverage:ignore-start -- Xcode 26 coverage runner cannot execute older OS sheet fallback.
154+
} else { // LCOV_EXCL_START -- Xcode 26 coverage runner cannot execute older OS sheet fallback.
155155
// Older OS / embed: fall back to a full-bleed background.
156156
if mesh {
157157
content.background {
@@ -160,7 +160,7 @@ private struct SheetBackdropModifier: ViewModifier {
160160
} else {
161161
content.background(.ultraThinMaterial, ignoresSafeAreaEdges: .all)
162162
}
163-
} // coverage:ignore-end
163+
} // LCOV_EXCL_STOP
164164
}
165165
}
166166

0 commit comments

Comments
 (0)