Skip to content

Commit 243e92f

Browse files
committed
[cov,otbn] Add coverage_view for boot binary
This change adds a `coverage_view_test` target to the OTBN crypto BUILD file for the `boot` binary. This allows for coverage filtering of the boot code. Change-Id: I4605a87677f1f198cadd34dbb5f65df5ed4332e8 Signed-off-by: Yi-Hsuan Deng <[email protected]>
1 parent 7403c91 commit 243e92f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

sw/otbn/crypto/BUILD

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
load("//rules:otbn.bzl", "otbn_binary", "otbn_library")
6+
load("//rules/coverage:view.bzl", "coverage_view_test")
67

78
package(default_visibility = ["//visibility:public"])
89

@@ -19,6 +20,12 @@ otbn_binary(
1920
],
2021
)
2122

23+
coverage_view_test(
24+
name = "boot_coverage_view",
25+
elf = ":boot",
26+
kind = "otbn",
27+
)
28+
2229
otbn_library(
2330
name = "ed25519",
2431
srcs = [

util/coverage/collect_cc_coverage/generate_coverage_view.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn find_executable_regions(
218218
/// across translation units may have a filename prefix separated by a colon.
219219
/// This function returns the base function name.
220220
fn dedup_inline_copies(name: &str) -> Result<&str> {
221-
Ok(name.split(':').last().context("Invalid function name")?)
221+
name.split(':').last().context("Invalid function name")
222222
}
223223

224224
/// Filters raw LCOV output to only include regions that exist in the binary.
@@ -282,7 +282,7 @@ fn filter_lcov_view(
282282
writeln!(filtered_lcov, "FN:{lineno},{name}")?;
283283
}
284284
}
285-
for (name, _count) in &filtered.fnda {
285+
for name in filtered.fnda.keys() {
286286
writeln!(filtered_lcov, "FNDA:0,{name}")?;
287287
}
288288
for lineno in &filtered.da {

0 commit comments

Comments
 (0)