45 int Test(
int argc,
char *argv[])
64 std::cout << comline.
LongUsage() << std::endl;
66 std::cout <<
"PlasCom2::Test: Exiting test function (success)" << std::endl;
71 << std::endl << comline.
ShortUsage() << std::endl;
73 std::cout <<
"PlasCom2::Test: Exiting test function (fail)" << std::endl;
79 std::ostream *Out = &std::cout;
80 std::ostringstream outStream;
84 std::string OutFileName(comline.
GetOption(
"output"));
85 std::string TestName(comline.
GetOption(
"name"));
86 std::string ListName(comline.
GetOption(
"list"));
87 std::string sverb(comline.
GetOption(
"verblevel"));
92 if(sverb !=
".true."){
93 std::istringstream Istr(sverb);
101 if(!OutFileName.empty()){
106 std::cout <<
"PlasCom2::Test: Entering test function" << std::endl;
114 if(!TestName.empty()){
116 test.
RunTest(TestName,results);
120 else if(!ListName.empty()){
121 std::ifstream ListInf;
122 ListInf.open(ListName.c_str());
124 std::cout <<
"PlasCom2::Test> Error: Could not open list of tests in file " 125 << ListName <<
". Exiting (fail)." << std::endl;
128 std::string testname;
129 while(std::getline(ListInf,testname))
130 test.
RunTest(testname,results);
137 *Out << results << std::endl;
139 *Out <<
"PlasCom2::Test: Exiting test function (success)" << std::endl;
142 if(!OutFileName.empty()){
143 Ouf.open(OutFileName.c_str(),std::ios::app);
145 std::cout <<
"PlasCom2::Test> Error: Could not open output file, " 146 << OutFileName <<
" for test output. Exiting (fail)." << std::endl;
149 Ouf << outStream.str();
160 int main(
int argc,
char *argv[])
int ProcessOptions()
Processes all command line tokens.
std::string ErrorReport()
Error reporting.
std::string GetOption(const char &s)
Get the value of an option.
Encapsulating class for collections of test results.
virtual void Process(ResultsType &result)
Runs all tests implemented by the PlasCom2::TestingObject.
int main(int argc, char *argv[])
void Initialize()
virtual function for program specific Initialization.
ComLineObject for PlasCom2 testing command-line interface.
Testing utilities for PlasCom2.
std::string LongUsage()
Generate long usage string.
Project-specific testing object.
virtual void RunTest(const std::string &name, ResultsType &result)
Runs a test specified by name.
int Test(int argc, char *argv[])
Drives the plascom2::TestObject.
std::string ShortUsage()
Generate short usage string.