diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-01-12 18:30:57 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-01-12 18:30:57 (GMT) |
commit | b4bf41434c048a47e55302b74ee54f9c097d32ed (patch) | |
tree | b5040c3e336a4082562cac765a2574a6d70f3d33 | |
parent | 002679fdba0e1ea19aca7e7a4303da25ab34df7c (diff) | |
download | CMake-b4bf41434c048a47e55302b74ee54f9c097d32ed.zip CMake-b4bf41434c048a47e55302b74ee54f9c097d32ed.tar.gz CMake-b4bf41434c048a47e55302b74ee54f9c097d32ed.tar.bz2 |
ENH: Only look for executable until found
-rw-r--r-- | Source/cmCTest.cxx | 110 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 5 |
2 files changed, 58 insertions, 57 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 70c02bd..a985fb3 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -4095,61 +4095,61 @@ int cmCTest::RunCMakeAndTest(std::string* outstring) else { failed.push_back(m_TestCommand); - } - std::string tryPath = m_TestCommand; - tryPath += cmSystemTools::GetExecutableExtension(); - if(cmSystemTools::FileExists(tryPath.c_str())) - { - fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); - } - else - { - failed.push_back(tryPath); - } - // try the Debug extension - tryPath = m_ConfigType + "/"; - tryPath += cmSystemTools::GetFilenameName(m_TestCommand); - if(cmSystemTools::FileExists(tryPath.c_str())) - { - fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); - } - else - { - failed.push_back(tryPath); - } - tryPath += cmSystemTools::GetExecutableExtension(); - if(cmSystemTools::FileExists(tryPath.c_str())) - { - fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); - } - else - { - failed.push_back(tryPath); - } - tryPath = m_ExecutableDirectory; - tryPath += "/"; - tryPath += m_TestCommand; - tryPath += cmSystemTools::GetExecutableExtension(); - if(cmSystemTools::FileExists(tryPath.c_str())) - { - fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); - } - else - { - failed.push_back(tryPath); - } - tryPath = m_ExecutableDirectory; - tryPath += "/"; - tryPath += m_ConfigType + "/"; - tryPath += m_TestCommand; - tryPath += cmSystemTools::GetExecutableExtension(); - if(cmSystemTools::FileExists(tryPath.c_str())) - { - fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); - } - else - { - failed.push_back(tryPath); + std::string tryPath = m_TestCommand; + tryPath += cmSystemTools::GetExecutableExtension(); + if(cmSystemTools::FileExists(tryPath.c_str())) + { + fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); + } + else + { + failed.push_back(tryPath); + // try the Debug extension + tryPath = m_ConfigType + "/"; + tryPath += cmSystemTools::GetFilenameName(m_TestCommand); + if(cmSystemTools::FileExists(tryPath.c_str())) + { + fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); + } + else + { + failed.push_back(tryPath); + tryPath += cmSystemTools::GetExecutableExtension(); + if(cmSystemTools::FileExists(tryPath.c_str())) + { + fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); + } + else + { + failed.push_back(tryPath); + tryPath = m_ExecutableDirectory; + tryPath += "/"; + tryPath += m_TestCommand; + tryPath += cmSystemTools::GetExecutableExtension(); + if(cmSystemTools::FileExists(tryPath.c_str())) + { + fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); + } + else + { + failed.push_back(tryPath); + tryPath = m_ExecutableDirectory; + tryPath += "/"; + tryPath += m_ConfigType + "/"; + tryPath += m_TestCommand; + tryPath += cmSystemTools::GetExecutableExtension(); + if(cmSystemTools::FileExists(tryPath.c_str())) + { + fullPath = cmSystemTools::CollapseFullPath(tryPath.c_str()); + } + else + { + failed.push_back(tryPath); + } + } + } + } + } } if(!cmSystemTools::FileExists(fullPath.c_str())) { diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 6b8099c..04d8e08 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -626,8 +626,9 @@ bool SystemTools::SameFile(const char* file1, const char* file2) // return true if the file exists bool SystemTools::FileExists(const char* filename) { - struct stat fs; - if (stat(filename, &fs) != 0) +// struct stat fs; +// if (stat(filename, &fs) != 0) + if ( access(filename, F_OK) != 0 ) { return false; } |