45 int Test(
int argc,
char *argv[])
60 int clerr = comline.ProcessOptions();
62 if(!comline.GetOption(
"help").empty()){
64 std::cout << comline.LongUsage() << std::endl;
66 std::cout <<
"Rocstar::Test: Exiting test function (success)" << std::endl;
70 std::cout << comline.ErrorReport() << std::endl
71 << std::endl << comline.ShortUsage() << std::endl;
73 std::cout <<
"Rocstar::Test: Exiting test function (fail)" << std::endl;
79 std::ostream *Out = &std::cout;
83 std::string OutFileName(comline.GetOption(
"output"));
84 std::string TestName(comline.GetOption(
"name"));
85 std::string ListName(comline.GetOption(
"list"));
86 std::string sverb(comline.GetOption(
"verblevel"));
91 if(sverb !=
".true."){
92 std::istringstream Istr(sverb);
100 if(!OutFileName.empty()){
101 Ouf.open(OutFileName.c_str());
103 std::cout <<
"Rocstar::Test> Error: Could not open output file, "
104 << OutFileName <<
" for test output. Exiting (fail)." << std::endl;
111 std::cout <<
"Rocstar::Test: Entering test function" << std::endl;
119 if(!TestName.empty()){
121 test.
RunTest(TestName,results);
125 else if(!ListName.empty()){
126 std::ifstream ListInf;
127 ListInf.open(ListName.c_str());
129 std::cout <<
"Rocstar::Test> Error: Could not open list of tests in file "
130 << ListName <<
". Exiting (fail)." << std::endl;
133 std::string testname;
134 while(std::getline(ListInf,testname))
135 test.
RunTest(testname,results);
142 *Out << results << std::endl;
148 *Out <<
"Rocstar::Test: Exiting test function (success)" << std::endl;
154 int main(
int argc,
char *argv[])
virtual void Process(ResultsType &result)
Runs all tests implemented by the Rocstar::TestingObject.
Project-specific testing object.
virtual void RunTest(const std::string &name, ResultsType &result)
Runs a test specified by name.
ComLineObject for Rocstar testing command-line interface.
Testing utilities for Rocstar.
int main(int argc, char *argv[])
int Test(int argc, char *argv[])
Drives the Rocstar::TestObject.
IRAD::Util::TestResults TestResults
Project-specific test results type.