Add verbose flag -V, which makes the output of tests to be displayed; also add help to ctest

This commit is contained in:
Andy Cedilnik 2002-09-24 18:34:16 -04:00
parent b5de000f26
commit 80f20047af
2 changed files with 31 additions and 4 deletions

View File

@ -228,7 +228,7 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed,
cmSystemTools::ReplaceString(output, cmSystemTools::ReplaceString(output,
dartStuff.match(1).c_str(),""); dartStuff.match(1).c_str(),"");
} }
if (output != "") if (output != "" && m_Verbose)
{ {
std::cerr << output.c_str() << "\n"; std::cerr << output.c_str() << "\n";
} }
@ -245,7 +245,7 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed,
cmSystemTools::ReplaceString(output, cmSystemTools::ReplaceString(output,
dartStuff.match(1).c_str(),""); dartStuff.match(1).c_str(),"");
} }
if (output != "") if (output != "" && m_Verbose)
{ {
std::cerr << output.c_str() << "\n"; std::cerr << output.c_str() << "\n";
} }
@ -266,6 +266,7 @@ int main (int argc, char *argv[])
std::vector<std::string> failed; std::vector<std::string> failed;
int total; int total;
ctest inst; ctest inst;
// look at the args // look at the args
@ -283,6 +284,11 @@ int main (int argc, char *argv[])
inst.m_ConfigType = args[i+1]; inst.m_ConfigType = args[i+1];
} }
if( arg.find("-V",0) == 0 || arg.find("--verbose",0) == 0 )
{
inst.m_Verbose = true;
}
if(arg.find("-R",0) == 0 && i < args.size() - 1) if(arg.find("-R",0) == 0 && i < args.size() - 1)
{ {
inst.m_UseIncludeRegExp = true; inst.m_UseIncludeRegExp = true;
@ -295,6 +301,25 @@ int main (int argc, char *argv[])
inst.m_ExcludeRegExp = args[i+1]; inst.m_ExcludeRegExp = args[i+1];
inst.m_UseExcludeRegExpFirst = inst.m_UseIncludeRegExp ? false : true; inst.m_UseExcludeRegExpFirst = inst.m_UseIncludeRegExp ? false : true;
} }
if(arg.find("-h") == 0 ||
arg.find("-help") == 0 ||
arg.find("-H") == 0 ||
arg.find("--help") == 0 ||
arg.find("/H") == 0 ||
arg.find("/HELP") == 0 ||
arg.find("/?") == 0)
{
std::cerr << "Usage: " << argv[0] << " <options>" << std::endl
<< "\t -D type Specify config type" << std::endl
<< "\t -E test Specify regular expression for tests to exclude"
<< std::endl
<< "\t -R test Specify regular expression for tests to include"
<< std::endl
<< "\t -V Verbose testing" << std::endl
<< "\t -H Help page" << std::endl;
return 1;
}
} }
// call process directory // call process directory

View File

@ -41,6 +41,7 @@ public:
m_UseIncludeRegExp = false; m_UseIncludeRegExp = false;
m_UseExcludeRegExp = false; m_UseExcludeRegExp = false;
m_UseExcludeRegExpFirst = false; m_UseExcludeRegExpFirst = false;
m_Verbose = false;
} }
bool m_UseIncludeRegExp; bool m_UseIncludeRegExp;
@ -51,6 +52,7 @@ public:
std::string m_ExcludeRegExp; std::string m_ExcludeRegExp;
std::string m_ConfigType; std::string m_ConfigType;
bool m_Verbose;
private: private:
}; };