13 namespace ElmerFoamFSI{
48 int Test(
int argc,
char *argv[])
62 int clerr = comline.ProcessOptions();
64 if(!comline.GetOption(
"help").empty()){
66 std::cout << comline.LongUsage() << std::endl;
68 std::cout <<
"ElmerFoamFSI::Test: Exiting test function (success)" << std::endl;
72 std::cout << comline.ErrorReport() << std::endl
73 << std::endl << comline.ShortUsage() << std::endl;
75 std::cout <<
"ElmerFoamFSI::Test: Exiting test function (fail)" << std::endl;
81 std::ostream *Out = &std::cout;
85 std::string OutFileName(comline.GetOption(
"output"));
86 std::string TestName(comline.GetOption(
"name"));
87 std::string ListName(comline.GetOption(
"list"));
88 std::string sverb(comline.GetOption(
"verblevel"));
89 std::string SourcePath(comline.GetOption(
"source"));
94 if(sverb !=
".true."){
95 std::istringstream Istr(sverb);
103 if(!OutFileName.empty()){
104 Ouf.open(OutFileName.c_str());
106 std::cout <<
"ElmerFoamFSI::Test> Error: Could not open output file, "
107 << OutFileName <<
" for test output. Exiting (fail)." << std::endl;
114 std::cout <<
"ElmerFoamFSI::Test: Entering test function" << std::endl;
123 if(!SourcePath.empty()){
128 if(!TestName.empty()){
130 test.
RunTest(TestName,results);
134 else if(!ListName.empty()){
135 std::ifstream ListInf;
136 ListInf.open(ListName.c_str());
138 std::cout <<
"ElmerFoamFSI::Test> Error: Could not open list of tests in file "
139 << ListName <<
". Exiting (fail)." << std::endl;
142 std::string testname;
143 while(std::getline(ListInf,testname))
144 test.
RunTest(testname,results);
151 *Out << results << std::endl;
157 *Out <<
"ElmerFoamFSI::Test: Exiting test function (success)" << std::endl;
163 int main(
int argc,
char *argv[])
int Test(int argc, char *argv[])
Drives the ElmerFoamFSI::TestObject.
ComLineObject for ElmerFoamFSI testing command-line interface.
virtual void Process(ResultsType &result)
Runs all tests implemented by the ElmerFoamFSI::TestingObject.
virtual void RunTest(const std::string &name, ResultsType &result)
Runs a test specified by name.
void SetSourceDirPath(std::string input)
Sets the string value of the testing source directory.
Testing utilities for ElmerFoamFSI.
Project-specific testing object.
IRAD::Util::TestResults TestResults
Project-specific test results type.