Nektar++
|
#include <MetricRegex.h>
Public Member Functions | |
~MetricRegex () override | |
Public Member Functions inherited from Nektar::Metric | |
Metric (TiXmlElement *metric, bool generate) | |
Constructor. More... | |
virtual | ~Metric ()=default |
bool | Test (std::istream &pStdout, std::istream &pStderr) |
Calls a metric's v_Test function (or v_Generate if m_generate ). More... | |
void | Generate (std::istream &pStdout, std::istream &pStderr) |
std::string | GetType () |
Return metric type. More... | |
int | GetID () |
Return metric ID. More... | |
bool | SupportsAverage () const |
Return whether this metric supports averaging results from multiple runs. More... | |
Static Public Member Functions | |
static MetricSharedPtr | create (TiXmlElement *metric, bool generate) |
Static Public Attributes | |
static std::string | type |
Protected Member Functions | |
MetricRegex (TiXmlElement *metric, bool generate) | |
Constructor. More... | |
bool | v_Test (std::istream &pStdout, std::istream &pStderr) override |
Test output against a regex expression and set of matches. More... | |
void | v_Generate (std::istream &pStdout, std::istream &pStderr) override |
Test output against a regex expression and set of matches. More... | |
virtual bool | v_Test (std::istream &pStdout, std::istream &pStderr)=0 |
Virtual function to test the metric. Should be redefined in derived classes. More... | |
virtual void | v_Generate (std::istream &pStdout, std::istream &pSrderr)=0 |
Virtual function to generate the metric. Should be redefined in derived classes. More... | |
Protected Attributes | |
std::regex | m_regex |
Storage for the boost regex. More... | |
std::vector< std::vector< MetricRegexFieldValue > > | m_matches |
Stores the multiple matches defined in each <MATCH> tag. More... | |
bool | m_unordered = false |
If true, regex matches may be in any order in output. More... | |
bool | m_useStderr = false |
If true, use stderr for testing/generation instead of stdout. More... | |
Protected Attributes inherited from Nektar::Metric | |
int | m_id |
Stores the ID of this metric. More... | |
std::string | m_type |
Stores the type of this metric (uppercase). More... | |
bool | m_generate |
Determines whether to generate this metric or not. More... | |
bool | m_average = false |
Indicates whether a metric supports averaging results from multiple runs. More... | |
TiXmlElement * | m_metric |
Pointer to XML structure containing metric definition. More... | |
Definition at line 66 of file MetricRegex.h.
|
inlineoverride |
Definition at line 69 of file MetricRegex.h.
|
protected |
Constructor.
Definition at line 51 of file MetricRegex.cpp.
References ASSERTL0, FilterPython_Function::field, Nektar::Metric::m_generate, Nektar::MetricRegexFieldValue::m_intTolerance, m_matches, m_regex, Nektar::MetricRegexFieldValue::m_tolerance, Nektar::Metric::m_type, Nektar::MetricRegexFieldValue::m_useIntTolerance, Nektar::MetricRegexFieldValue::m_useTolerance, and Nektar::MetricRegexFieldValue::m_value.
Referenced by create().
|
inlinestatic |
Definition at line 73 of file MetricRegex.h.
References MetricRegex().
|
overrideprotectedvirtual |
Test output against a regex expression and set of matches.
Implements Nektar::Metric.
Definition at line 268 of file MetricRegex.cpp.
References ASSERTL0, FilterPython_Function::field, m_matches, Nektar::Metric::m_metric, m_regex, Nektar::Metric::m_type, m_useStderr, Nektar::MetricRegexFieldValue::m_useTolerance, and Nektar::MetricRegexFieldValue::m_value.
Referenced by Nektar::MetricEigenvalue::v_Generate(), Nektar::MetricL2::v_Generate(), Nektar::MetricLInf::v_Generate(), Nektar::MetricPrecon::v_Generate(), and Nektar::MetricPyUnitTest::v_Generate().
|
overrideprotectedvirtual |
Test output against a regex expression and set of matches.
Implements Nektar::Metric.
Definition at line 115 of file MetricRegex.cpp.
References tinysimd::abs(), ASSERTL0, m_matches, m_regex, m_unordered, and m_useStderr.
|
protected |
Stores the multiple matches defined in each <MATCH> tag.
Definition at line 84 of file MetricRegex.h.
Referenced by Nektar::MetricEigenvalue::MetricEigenvalue(), Nektar::MetricL2::MetricL2(), Nektar::MetricLInf::MetricLInf(), Nektar::MetricPrecon::MetricPrecon(), Nektar::MetricPyUnitTest::MetricPyUnitTest(), MetricRegex(), Nektar::MetricEigenvalue::v_Generate(), Nektar::MetricL2::v_Generate(), Nektar::MetricLInf::v_Generate(), Nektar::MetricPrecon::v_Generate(), Nektar::MetricPyUnitTest::v_Generate(), v_Generate(), and v_Test().
|
protected |
Storage for the boost regex.
Definition at line 82 of file MetricRegex.h.
Referenced by Nektar::MetricEigenvalue::MetricEigenvalue(), Nektar::MetricL2::MetricL2(), Nektar::MetricLInf::MetricLInf(), Nektar::MetricPrecon::MetricPrecon(), Nektar::MetricPyUnitTest::MetricPyUnitTest(), MetricRegex(), v_Generate(), and v_Test().
|
protected |
If true, regex matches may be in any order in output.
Definition at line 86 of file MetricRegex.h.
Referenced by Nektar::MetricEigenvalue::MetricEigenvalue(), and v_Test().
|
protected |
If true, use stderr for testing/generation instead of stdout.
Definition at line 88 of file MetricRegex.h.
Referenced by Nektar::MetricPyUnitTest::MetricPyUnitTest(), v_Generate(), and v_Test().
|
static |
Definition at line 78 of file MetricRegex.h.