diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-05-06 14:30:29 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-05-06 14:30:29 (GMT) |
commit | cd002c0b2036ce0cb83b2dead056cddd6691cefe (patch) | |
tree | 66684429956deaaa10969617164f27e233ea1082 | |
parent | 8d41f97ff65b1aa35a0cd15081f66210ff8b483a (diff) | |
download | CMake-cd002c0b2036ce0cb83b2dead056cddd6691cefe.zip CMake-cd002c0b2036ce0cb83b2dead056cddd6691cefe.tar.gz CMake-cd002c0b2036ce0cb83b2dead056cddd6691cefe.tar.bz2 |
BUG: fix ctest so that the search path for test executables produces better output and does not use config dir when it is not set
-rw-r--r-- | Source/cmCTest.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 888dec8..7eb2ba3 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -4793,7 +4793,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) // try the Debug extension tryPath = m_ConfigType + "/"; tryPath += cmSystemTools::GetFilenameName(m_TestCommand); - if(cmSystemTools::FileExists(tryPath.c_str()) + if(m_ConfigType.size() && cmSystemTools::FileExists(tryPath.c_str()) && !cmSystemTools::FileIsDirectory(tryPath.c_str())) { fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); @@ -4802,7 +4802,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) { failed.push_back(tryPath); tryPath += cmSystemTools::GetExecutableExtension(); - if(cmSystemTools::FileExists(tryPath.c_str()) + if(m_ConfigType.size() && cmSystemTools::FileExists(tryPath.c_str()) && !cmSystemTools::FileIsDirectory(tryPath.c_str())) { fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); @@ -4824,7 +4824,10 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) failed.push_back(tryPath); tryPath = m_ExecutableDirectory; tryPath += "/"; - tryPath += m_ConfigType + "/"; + if(m_ConfigType.size()) + { + tryPath += m_ConfigType + "/"; + } tryPath += m_TestCommand; tryPath += cmSystemTools::GetExecutableExtension(); if(cmSystemTools::FileExists(tryPath.c_str()) @@ -4837,7 +4840,13 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) failed.push_back(tryPath); std::string filepath = cmSystemTools::GetFilenamePath(m_TestCommand); std::string filename = cmSystemTools::GetFilenameName(m_TestCommand); - tryPath = filepath + "/" + m_ConfigType + "/" + filename; + tryPath = filepath + "/"; + if(m_ConfigType.size()) + { + tryPath += m_ConfigType; + tryPath += "/"; + } + tryPath += filename; if ( cmSystemTools::FileExists(tryPath.c_str()) && !cmSystemTools::FileIsDirectory(tryPath.c_str()) ) { @@ -4858,6 +4867,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) out << "Could not find path to executable, perhaps it was not built: " << m_TestCommand << "\n"; out << "tried to find it in these places:\n"; + out << fullPath.c_str() << "\n"; for(unsigned int i=0; i < failed.size(); ++i) { out << failed[i] << "\n"; @@ -4899,7 +4909,7 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) int runTestRes = this->RunTest(testCommand, &outs, &retval, 0); if(runTestRes != cmsysProcess_State_Exited || retval != 0) { - out << "Test failed to run.\n"; + out << "Failed to run test command: " << testCommand[0] << "\n"; retval = 1; } |