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,
dartStuff.match(1).c_str(),"");
}
if (output != "")
if (output != "" && m_Verbose)
{
std::cerr << output.c_str() << "\n";
}
@ -245,7 +245,7 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed,
cmSystemTools::ReplaceString(output,
dartStuff.match(1).c_str(),"");
}
if (output != "")
if (output != "" && m_Verbose)
{
std::cerr << output.c_str() << "\n";
}
@ -266,6 +266,7 @@ int main (int argc, char *argv[])
std::vector<std::string> failed;
int total;
ctest inst;
// look at the args
@ -282,6 +283,11 @@ int main (int argc, char *argv[])
{
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)
{
@ -295,6 +301,25 @@ int main (int argc, char *argv[])
inst.m_ExcludeRegExp = args[i+1];
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

View File

@ -38,9 +38,10 @@ public:
* constructor
*/
ctest() {
m_UseIncludeRegExp = false;
m_UseExcludeRegExp = false;
m_UseIncludeRegExp = false;
m_UseExcludeRegExp = false;
m_UseExcludeRegExpFirst = false;
m_Verbose = false;
}
bool m_UseIncludeRegExp;
@ -51,6 +52,7 @@ public:
std::string m_ExcludeRegExp;
std::string m_ConfigType;
bool m_Verbose;
private:
};