add command line option -D for config directory to run

This commit is contained in:
Bill Hoffman 2002-02-26 15:15:16 -05:00
parent 800db3a063
commit 0b6f8be725
2 changed files with 21 additions and 3 deletions

View File

@ -58,7 +58,21 @@ std::string ctest::FindExecutable(const char *exe)
std::string file;
cmSystemTools::SplitProgramPath(exe, dir, file);
if(m_ConfigType != "")
{
if(TryExecutable(dir.c_str(), file.c_str(), &fullPath, m_ConfigType.c_str()))
{
return fullPath;
}
std::string tried = dir;
dir += "/";
dir += m_ConfigType;
dir += "/";
dir += file;
cmSystemTools::Error("config type specified on the command line, but test executable not found.",
dir.c_str());
return "";
}
if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,"."))
{
return fullPath;
@ -183,7 +197,6 @@ void ctest::ProcessDirectory(int &passed, std::vector<std::string> &failed)
*/
std::string output;
int retVal;
if (!cmSystemTools::RunCommand(testCommand.c_str(), output,
retVal, false) || retVal != 0)
{
@ -245,6 +258,11 @@ int main (int argc, char *argv[])
for(unsigned int i=1; i < args.size(); ++i)
{
std::string arg = args[i];
if(arg.find("-D",0) == 0 && i < args.size() - 1)
{
inst.m_ConfigType = args[i+1];
}
if(arg.find("-R",0) == 0 && i < args.size() - 1)
{
inst.m_UseRegExp = true;

View File

@ -40,7 +40,7 @@ public:
bool m_UseRegExp;
std::string m_RegExp;
std::string m_ConfigType;
private:
};