Skip to content

Commit 8ae38a6

Browse files
post-process: fix coverage link (#308)
Fixes: #307
1 parent 8741a06 commit 8ae38a6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

post-processing/analyses/fuzz_optimal_targets.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def analysis_func(
7272
html_string += self.get_optimal_target_section(
7373
optimal_target_functions,
7474
toc_list,
75-
tables
75+
tables,
76+
coverage_url
7677
)
7778

7879
# Create section for how the state of the project will be if
@@ -209,7 +210,8 @@ def get_optimal_target_section(
209210
self,
210211
optimal_target_functions: List[fuzz_data_loader.FunctionProfile],
211212
toc_list: List[Tuple[str, str, int]],
212-
tables: List[str]
213+
tables: List[str],
214+
coverage_url: str
213215
) -> str:
214216
# Table with details about optimal target functions
215217
html_string = fuzz_html_helpers.html_add_header_with_link(
@@ -242,8 +244,13 @@ def get_optimal_target_section(
242244
]
243245
)
244246
for fd in optimal_target_functions:
247+
func_cov_url = "%s%s.html#L%d" % (
248+
coverage_url,
249+
fd.function_source_file,
250+
fd.function_linenumber
251+
)
245252
html_func_row = (
246-
f"<a href=\"#\"><code class='language-clike'>"
253+
f"<a href=\"{ func_cov_url }\"><code class='language-clike'>"
247254
f"{fuzz_utils.demangle_cpp_func(fd.function_name)}"
248255
f"</code></a>"
249256
)

0 commit comments

Comments
 (0)