|
KiCad PCB EDA Suite
|
Custom REPORTER that captures all messages for later analysis in the unit test framework. More...
#include <board_test_utils.h>
Classes | |
| struct | MESSAGE |
Public Types | |
| enum | LOCATION { LOC_HEAD = 0 , LOC_BODY , LOC_TAIL } |
| Location where the message is to be reported. More... | |
Public Member Functions | |
| CAPTURING_REPORTER () | |
| REPORTER & | Report (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override |
| Report a string with a given severity. | |
| bool | HasMessage () const override |
| Returns true if any messages were reported. | |
| EDA_UNITS | GetUnits () const override |
| void | Clear () override |
| void | PrintAllMessages (const std::string &aContext) const |
| int | GetErrorCount () const |
| int | GetWarningCount () const |
| const std::vector< MESSAGE > & | GetMessages () const |
| REPORTER & | Report (const char *aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) |
| virtual REPORTER & | ReportTail (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) |
| Places the report at the end of the list, for objects that support report ordering. | |
| virtual REPORTER & | ReportHead (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) |
| Places the report at the beginning of the list for objects that support ordering. | |
| REPORTER & | operator<< (const wxString &aText) |
| virtual bool | HasMessageOfSeverity (int aSeverityMask) const |
| Returns true if the reporter has one or more messages matching the specified severity mask. | |
Private Attributes | |
| std::vector< MESSAGE > | m_messages |
| int | m_errorCount |
| int | m_warningCount |
| int | m_infoCount |
| int | m_reportedSeverityMask |
Custom REPORTER that captures all messages for later analysis in the unit test framework.
Definition at line 340 of file board_test_utils.h.
|
inherited |
Location where the message is to be reported.
LOC_HEAD messages are printed before all others (typically intro messages) LOC_BODY messages are printed in the middle LOC_TAIL messages are printed after all others (typically status messages)
| Enumerator | |
|---|---|
| LOC_HEAD | |
| LOC_BODY | |
| LOC_TAIL | |
Definition at line 90 of file reporter.h.
|
inline |
Definition at line 349 of file board_test_utils.h.
References m_errorCount, m_infoCount, and m_warningCount.
|
inlineoverridevirtual |
Reimplemented from REPORTER.
Definition at line 362 of file board_test_utils.h.
References m_errorCount, m_infoCount, m_messages, and m_warningCount.
|
inline |
Definition at line 372 of file board_test_utils.h.
References m_errorCount.
Referenced by AssertNoErrors().
|
inline |
Definition at line 374 of file board_test_utils.h.
References m_messages.
Referenced by AssertNoErrors().
|
inlineoverridevirtual |
|
inline |
Definition at line 373 of file board_test_utils.h.
References m_warningCount.
|
inlineoverridevirtual |
Returns true if any messages were reported.
Reimplemented from REPORTER.
Definition at line 358 of file board_test_utils.h.
References m_messages.
|
inlinevirtualinherited |
Returns true if the reporter has one or more messages matching the specified severity mask.
Reimplemented in WX_HTML_PANEL_REPORTER.
Definition at line 145 of file reporter.h.
References m_reportedSeverityMask.
Referenced by DRC_ENGINE::compileRules(), DIALOG_SIM_MODEL< T >::loadLibrary(), NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), SIM_LIB_MGR::SetLibrary(), and SIMULATOR_FRAME::showNetlistErrors().
|
inlineinherited |
Definition at line 131 of file reporter.h.
References Report(), and REPORTER().
| void KI_TEST::CAPTURING_REPORTER::PrintAllMessages | ( | const std::string & | aContext | ) | const |
Definition at line 780 of file board_test_utils.cpp.
References BOOST_TEST_MESSAGE(), m_errorCount, m_messages, m_warningCount, RPT_SEVERITY_ACTION, RPT_SEVERITY_DEBUG, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, and RPT_SEVERITY_WARNING.
|
overridevirtual |
Report a string with a given severity.
| aText | is the string to report. |
| aSeverity | is an indicator ( RPT_UNDEFINED, RPT_INFO, RPT_WARNING, RPT_ERROR, RPT_ACTION ) used to filter and format messages |
Reimplemented from REPORTER.
Definition at line 760 of file board_test_utils.cpp.
References m_errorCount, m_infoCount, m_messages, m_warningCount, REPORTER::REPORTER(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, KI_TEST::CAPTURING_REPORTER::MESSAGE::severity, and KI_TEST::CAPTURING_REPORTER::MESSAGE::text.
|
inherited |
Definition at line 77 of file reporter.cpp.
References From_UTF8(), Report(), and REPORTER().
|
inlinevirtualinherited |
Places the report at the beginning of the list for objects that support ordering.
Reimplemented in WX_HTML_PANEL_REPORTER.
Definition at line 123 of file reporter.h.
References Report(), REPORTER(), and RPT_SEVERITY_UNDEFINED.
Referenced by BACK_ANNOTATE::applyChangelist(), and SCH_EDIT_FRAME::WriteNetListFile().
|
inlinevirtualinherited |
Places the report at the end of the list, for objects that support report ordering.
Reimplemented in WX_HTML_PANEL_REPORTER.
Definition at line 114 of file reporter.h.
References Report(), REPORTER(), and RPT_SEVERITY_UNDEFINED.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), EXCELLON_WRITER::CreateDrillandMapFilesSet(), GERBER_WRITER::CreateDrillandMapFilesSet(), SCH_PLOTTER::createDXFFiles(), SCH_PLOTTER::createPDFFile(), SCH_PLOTTER::createPNGFiles(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_PLOTTER::createPSFiles(), SCH_PLOTTER::createSVGFiles(), SCH_SCREEN::UpdateSymbolLinks(), and SCH_EDIT_FRAME::WriteNetListFile().
|
private |
Definition at line 378 of file board_test_utils.h.
Referenced by CAPTURING_REPORTER(), Clear(), GetErrorCount(), PrintAllMessages(), and Report().
|
private |
Definition at line 380 of file board_test_utils.h.
Referenced by CAPTURING_REPORTER(), Clear(), and Report().
|
private |
Definition at line 377 of file board_test_utils.h.
Referenced by Clear(), GetMessages(), HasMessage(), PrintAllMessages(), and Report().
|
privateinherited |
Definition at line 161 of file reporter.h.
Referenced by Clear(), HasMessage(), HasMessageOfSeverity(), Report(), and REPORTER().
|
private |
Definition at line 379 of file board_test_utils.h.
Referenced by CAPTURING_REPORTER(), Clear(), GetWarningCount(), PrintAllMessages(), and Report().