Skip to content
Snippets Groups Projects
Commit 884bd004 authored by Dave Moxey's avatar Dave Moxey
Browse files

Revert changes to tester for another branch

parent 3132971b
No related branches found
No related tags found
No related merge requests found
......@@ -51,9 +51,6 @@ namespace Nektar
// We do not mind which order the converged eigenvalues are listed.
m_unordered = true;
// Ignore additional regex matches
m_ignoreExtra = true;
// Regex for FP numbers of forms: 120, -23, 4.345, 2.4563e-01, -nan
std::string fp = "-?\\d+\\.?\\d*(?:e[+-]\\d+)?|-?nan";
......
......@@ -51,7 +51,6 @@ namespace Nektar
// error.
m_regex = "^L 2 error\\s*(?:\\(variable "
"(\\w+)\\))?\\s*:\\s*([+-]?\\d.+\\d|-?\\d|[+-]?nan|[+-]?inf).*";
m_ignoreExtra = true;
// Find the L2 error to match against.
TiXmlElement *value = metric->FirstChildElement("value");
......
......@@ -51,8 +51,7 @@ namespace Nektar
// error.
m_regex = "^L inf\\w* error\\s*(?:\\(variable "
"(\\w+)\\))?\\s*:\\s*([+-]?\\d.+\\d|-?\\d|[+-]?nan|[+-]?inf).*";
m_ignoreExtra = true;
// Find the L2 error to match against.
TiXmlElement *value = metric->FirstChildElement("value");
ASSERTL0(value || m_generate, "Missing value tag for LInf metric!");
......
......@@ -51,9 +51,8 @@ namespace Nektar
Metric(metric, generate)
{
// Default behaviour is that the regexes listed in the input file must
// be matched in order and we match everything.
// be matched in order.
m_unordered = false;
m_ignoreExtra = false;
// If we are a derived class, do nothing
if (m_type != "REGEX")
......@@ -128,33 +127,13 @@ namespace Nektar
// Process output file line by line searching for regex matches
std::string line;
int gotMatches = 0;
while (getline(pStdout, line))
while (getline(pStdout, line) && m_matches.size() > 0)
{
matchedTol = true;
// Test to see if we have a match on this line.
if (boost::regex_match(line.c_str(), matches, m_regex))
{
++gotMatches;
// In this case we have found more matches than are specified in
// the match list. Either ignore this if m_ignoreExtra is set,
// or keep going.
if (m_matches.size() == 0)
{
if (m_ignoreExtra)
{
--gotMatches;
break;
}
else
{
continue;
}
}
// Error if no fields in regex then throw an error.
if (matches.size() == 1)
{
......@@ -272,10 +251,10 @@ namespace Nektar
}
}
if (gotMatches != nMatch)
if (m_matches.size() != 0)
{
cerr << "Expected " << nMatch << " matches but found "
<< gotMatches << "!" << endl;
cerr << "Expected " << nMatch << " matches but only found "
<< (nMatch - m_matches.size()) << "!" << endl;
success = false;
}
......
......@@ -78,9 +78,6 @@ namespace Nektar
std::vector<std::vector<MetricRegexFieldValue> > m_matches;
/// If true, regex matches may be in any order in output
bool m_unordered;
/// If true, ignore any extra matches (i.e. if the output produces more
/// matches than we expect, the additional ones are ignored.
bool m_ignoreExtra;
MetricRegex(TiXmlElement *metric, bool generate);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment