ValidationReport Class
Report produced by running a ContractRegistry. More...
Declaration
Included Headers
Public Constructors Index
| ValidationReport ()=default | |
|
Construct an empty report. More... | |
Public Member Functions Index
| void | add_issue (ValidationIssue issue) |
|
Append an issue to the report. More... | |
| void | add_info (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={}) |
|
Append an Info issue. More... | |
| void | add_warning (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={}) |
|
Append a Warning issue. More... | |
| void | add_error (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={}) |
|
Append an Error issue. More... | |
| void | note_contract_run (std::string id) |
|
Record that a contract id participated in this validation pass. More... | |
| void | set_mode (int mode) |
|
Record which Session mode produced this report (integer to avoid Contract.h include). More... | |
| int | mode () const |
|
Mode integer set via set_mode(). More... | |
| const std::vector< ValidationIssue > & | issues () const noexcept |
|
All issues collected, in insertion order. More... | |
| const std::vector< std::string > & | contracts_run () const noexcept |
|
Ids of all contracts that ran (in evaluation order). More... | |
| bool | ok () const noexcept |
|
True if the report contains no errors (warnings/info are still allowed). More... | |
| bool | has_errors () const noexcept |
|
True if at least one issue with Error severity is present. More... | |
| std::size_t | error_count () const noexcept |
|
Count of Error issues in the report. More... | |
| std::size_t | warning_count () const noexcept |
|
Count of Warning issues in the report. More... | |
| std::size_t | info_count () const noexcept |
|
Count of Info issues in the report. More... | |
| std::string | to_string () const |
|
Render the report as a deterministic, human-readable text block. More... | |
| std::string | to_json () const |
|
Serialize the report as a JSON string (CI/dashboard-friendly). More... | |
Private Member Attributes Index
| int | mode_ = 0 |
| std::vector< std::string > | contracts_run_ |
| std::vector< ValidationIssue > | issues_ |
Private Static Functions Index
| static std::string | json_escape_ (const std::string &s) |
Description
Report produced by running a ContractRegistry.
Aggregates all issues emitted by every contract that was run, plus the list of contract ids that participated. STL-only, CI-friendly, and safe to serialize via to_string() (text) or to_json() (JSON).
- See Also
- See Also
Definition at line 82 of file ValidationReport.h.
Public Constructors
ValidationReport()
| default |
Construct an empty report.
Definition at line 85 of file ValidationReport.h.
Public Member Functions
add_error()
| inline |
Append an Error issue.
Definition at line 109 of file ValidationReport.h.
add_info()
| inline |
Append an Info issue.
Definition at line 95 of file ValidationReport.h.
add_issue()
| inline |
Append an issue to the report.
Definition at line 90 of file ValidationReport.h.
add_warning()
| inline |
Append a Warning issue.
Definition at line 102 of file ValidationReport.h.
contracts_run()
| inline noexcept |
Ids of all contracts that ran (in evaluation order).
Definition at line 136 of file ValidationReport.h.
error_count()
| inline noexcept |
Count of Error issues in the report.
Definition at line 155 of file ValidationReport.h.
has_errors()
| inline noexcept |
True if at least one issue with Error severity is present.
Definition at line 146 of file ValidationReport.h.
info_count()
| inline noexcept |
Count of Info issues in the report.
Definition at line 173 of file ValidationReport.h.
issues()
| inline noexcept |
All issues collected, in insertion order.
Definition at line 132 of file ValidationReport.h.
mode()
| inline |
Mode integer set via set_mode().
Definition at line 125 of file ValidationReport.h.
note_contract_run()
| inline |
Record that a contract id participated in this validation pass.
Definition at line 116 of file ValidationReport.h.
ok()
| inline noexcept |
True if the report contains no errors (warnings/info are still allowed).
Definition at line 141 of file ValidationReport.h.
set_mode()
| inline |
Record which Session mode produced this report (integer to avoid Contract.h include).
Definition at line 121 of file ValidationReport.h.
to_json()
| inline |
Serialize the report as a JSON string (CI/dashboard-friendly).
Definition at line 210 of file ValidationReport.h.
to_string()
| inline |
Render the report as a deterministic, human-readable text block.
Definition at line 184 of file ValidationReport.h.
warning_count()
| inline noexcept |
Count of Warning issues in the report.
Definition at line 164 of file ValidationReport.h.
Private Member Attributes
contracts_run_
|
Definition at line 294 of file ValidationReport.h.
issues_
|
Definition at line 295 of file ValidationReport.h.
mode_
|
Definition at line 293 of file ValidationReport.h.
Private Static Functions
json_escape_()
| inline static |
Definition at line 251 of file ValidationReport.h.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.