Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/articles/verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The report is titled with the device name and opens with a header describing the
- **Checked against** is the version of the specification used to verify the device, together with the reason when that is narrower than the version declared by the device.
- **Specification** links to the specification documents as they stood at the revision behind the checks.
- **Register set** names the generator package supplying the core register metadata, which fully determines the register set expected by the run.
- **Toolkit version** identifies the build of `harp.toolkit` that produced the report, including its source commit.

#### Report path
```ps1
Expand Down
1 change: 1 addition & 0 deletions src/Harp.Toolkit/Verify/Report.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ public class Report
public string ProtocolCommit { get; set; } = string.Empty;
public string ProtocolCommitUrl { get; set; } = string.Empty;
public string RegisterSetVersion { get; set; } = string.Empty;
public string ToolkitVersion { get; set; } = string.Empty;
public List<SuiteResult> Suites { get; set; } = new();
}
2 changes: 2 additions & 0 deletions src/Harp.Toolkit/Verify/ReportTemplate.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<dd class="col-sm-8"><a href="@Model.ProtocolCommitUrl" target="_blank" rel="noopener">@Model.ProtocolCommit</a></dd>
<dt class="col-sm-4">Register set</dt>
<dd class="col-sm-8">Harp.Generators @Model.RegisterSetVersion</dd>
<dt class="col-sm-4">Toolkit version</dt>
<dd class="col-sm-8 text-break">@Model.ToolkitVersion</dd>
</dl>
</div>
</div>
Expand Down
12 changes: 11 additions & 1 deletion src/Harp.Toolkit/Verify/VerifyCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.CommandLine;
using System.Reflection;
using Spectre.Console;
using Harp.Generators;
using Harp.Toolkit.Verify.Suites;
Expand Down Expand Up @@ -126,7 +127,8 @@ static async Task<int> RunVerification(string portName, FileInfo? reportFile, bo
CheckedProtocolVersion = GetCheckedVersion(target),
ProtocolCommit = ProtocolReference.ShortCommit,
ProtocolCommitUrl = ProtocolReference.TreeUrl,
RegisterSetVersion = CoreSchema.Version
RegisterSetVersion = CoreSchema.Version,
ToolkitVersion = GetToolkitVersion()
};

int currentTest = 0;
Expand Down Expand Up @@ -240,6 +242,14 @@ static string DescribeAbort(TimeoutException exception, int completedCount, int
"Rerun the verification once the device and the connection are stable.";
}

static string GetToolkitVersion()
{
var assembly = typeof(VerifyCommand).Assembly;
return assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion
?? assembly.GetName().Version?.ToString()
?? "not reported";
}

static string GetDeclaredVersion(ProtocolTarget target)
{
return target.DeclaredVersion.HasValue
Expand Down
Loading