Skip to content

Commit 6fa0b54

Browse files
committed
Always add link to CSV
1 parent c541cb9 commit 6fa0b54

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/report.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import Printf: @sprintf
55

66
function _status_cell(ok::Bool, t::Float64, logFile::Union{String,Nothing})
77
link = isnothing(logFile) ? "" : """ <a href="$(logFile)">(log)</a>"""
8+
time = t > 0 ? @sprintf("%.2f", t) * " s" : ""
89
if ok
9-
return """<td class="ok">&#10003; $(@sprintf "%.2f" t) s$link</td>"""
10+
return """<td class="ok">&#10003;$(time)$(link)</td>"""
1011
else
11-
return """<td class="fail">&#10007;$link</td>"""
12+
return """<td class="fail">&#10007;$(time)$(link)</td>"""
1213
end
1314
end
1415

@@ -18,12 +19,17 @@ function _cmp_cell(r::ModelResult, results_root::String)
1819
end
1920
n, p = r.cmp_total, r.cmp_pass
2021
if p == n
21-
return """<td class="ok">&#10003; $p/$n</td>"""
22+
# No diff CSV when all signals pass — link the sim CSV instead
23+
short = split(r.name, ".")[end]
24+
sim_csv = joinpath("files", r.name, "$(short)_sim.csv")
25+
csv_link = isfile(joinpath(results_root, sim_csv)) ? """ <a href="$sim_csv">(CSV)</a>""" : ""
26+
return """<td class="ok">&#10003; $p/$n$(csv_link)</td>"""
2227
else
2328
# Link to the interactive diff HTML (next to the CSV, same name, .html extension)
2429
diff_html = replace(r.cmp_csv, r"\.csv$" => ".html")
2530
rel = relpath(isfile(diff_html) ? diff_html : r.cmp_csv, results_root)
26-
return """<td class="fail"><a href="$rel">$p/$n</a></td>"""
31+
csv_link = isempty(r.cmp_csv) ? "" : """ <a href="$(relpath(r.cmp_csv, results_root))">(CSV)</a>"""
32+
return """<td class="fail"><a href="$rel">$p/$n</a>$(csv_link)</td>"""
2733
end
2834
end
2935

0 commit comments

Comments
 (0)