33 template <
typename ValueType>
34 void AddResult(
const std::string &name,
const ValueType &result)
38 std::ostringstream Ostr;
54 template<
typename ValueType>
57 std::ostringstream Ostr;
59 results::iterator _thisit = this->begin();
60 while(_thisit != this->end()){
61 if(_thisit->first == name){
62 _thisit->second = Ostr.str();
67 return(AddResult<ValueType>(name,result));
83 template<
typename ResultsType = results>
88 typedef void (
manager::*TestFunctionType)(ResultsType &);
95 typename FunctionMapType::iterator testFunctionMapIterator = testFunctionMap.begin();
96 while(testFunctionMapIterator != testFunctionMap.end()){
97 TestFunctionType TestFunction = testFunctionMapIterator++->second;
98 (this->*TestFunction)(results);
105 std::list<std::string>::iterator nameIterator = names.begin();
106 while(nameIterator != names.end())
107 RunTest(*nameIterator++,results);
112 typename FunctionMapType::iterator testFunctionMapIterator = testFunctionMap.find(name);
113 if(testFunctionMapIterator != testFunctionMap.end()){
115 TestFunctionType TestFunction = testFunctionMapIterator->second;
116 (this->*TestFunction)(results);
123 virtual void AddTest(
const std::string &testName,TestFunctionType TestFunc){
124 testFunctionMap[testName] = TestFunc;
128 typename FunctionMapType::iterator testFunctionMapIterator = testFunctionMap.begin();
129 while(testFunctionMapIterator != testFunctionMap.end())
130 outStream << testFunctionMapIterator++->first << std::endl;
134 FunctionMapType testFunctionMap;
FunctionMapType & FunctionMap()
std::map< std::string, TestFunctionType > FunctionMapType
int RunTest(int argc, char *argv[])
Runs test programs and scripts through a standard interface.
virtual void ListTests(std::ostream &outStream)
virtual void ProcessTests(std::list< std::string > &names, Results &results)
Process named tests from a list and populate a "results" object.
virtual void Process(Results &results)
Process all tests and populate a "results" object.
virtual void Epilogue()
Clean up any test fixtures that need cleaning.
Defines MPI-specific parallel global and program classes.
Encapsulating class for collections of test results.
void UpdateResult(const std::string &name, const ValueType &result)
Updates an existing test result.
virtual void RunTest(const std::string &name, Results &results)
Run a particular test.
virtual void AddTest(const std::string &testName, TestFunctionType TestFunc)
Add a test.
Parameters object interface (for config files, etc)
void AddResult(const std::string &name, const ValueType &result)
Add a named result to the test results.
virtual void Prologue()
Set up the tests and any test fixture constructs.
Interface for a general testing object.