Skip to content

Commit

Permalink
[ci] add urg assertion report detail section in summary report
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Oct 13, 2024
1 parent 725d01b commit 8820af1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nix/t1/run/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ let
cp -vr $emuOutput $out
chmod -R u+w $out
${vcs-emu.vcs-fhs-env}/bin/vcs-fhs-env -c "urg -dir $emuOutput/*/cm.vdb -format text"
${vcs-emu.vcs-fhs-env}/bin/vcs-fhs-env -c "urg -dir $emuOutput/*/cm.vdb -format text -metric assert -show summary"
cp -vr urgReport $out/
'';
in
Expand Down
13 changes: 11 additions & 2 deletions script/ci/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -291,17 +291,26 @@ object Main:
Logger.info("Filtering urg report")
val finalMdPath = os.Path(urgReportFilePath.get, os.pwd)
val urgAssertFile = emuResultPath / "urgReport" / "asserts.txt"
val heading = "^Summary for Cover Properties$".r
val summaryHeading = "^Summary for Cover Properties$".r
val coverSummaryStr =
os.read(urgAssertFile)
.lines()
.dropWhile(!heading.matches(_))
.dropWhile(!summaryHeading.matches(_))
.takeWhile(_.distinct != "-")
.toArray
.mkString("\n")
val detailHeading = "^Detail Report for Cover Properties$".r
val coverDetailStr =
os.read(urgAssertFile)
.lines()
.dropWhile(!detailHeading.matches(_))
.toArray
.mkString("\n")
os.write.append(finalMdPath, s"### Coverage for $config \n")
os.write.append(finalMdPath, "```text\n")
os.write.append(finalMdPath, coverSummaryStr)
os.write.append(finalMdPath, "----------------------\n")
os.write.append(finalMdPath, coverDetailStr)
os.write.append(finalMdPath, "\n```\n")

os.write.over(file, ujson.write(cycleRecord, indent = 2))
Expand Down

0 comments on commit 8820af1

Please sign in to comment.