summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-11-10 15:40:24 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2009-11-10 15:40:24 (GMT)
commitc9c0ee4056aa651a63ee6c34abb06e60e987dbe3 (patch)
tree869a02a81b1ff9cc2790bd73290030d743fac854 /Source/CTest
parent21a59bdc4d4c54af5cd175561f9249d5932434d2 (diff)
downloadCMake-c9c0ee4056aa651a63ee6c34abb06e60e987dbe3.zip
CMake-c9c0ee4056aa651a63ee6c34abb06e60e987dbe3.tar.gz
CMake-c9c0ee4056aa651a63ee6c34abb06e60e987dbe3.tar.bz2
Change logic of ctest subdirs command to allow for absolute paths. Also added test coverage for passing absolute paths to subdirs.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index d314052..f6dede8 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -82,17 +82,20 @@ bool cmCTestSubdirCommand
for ( it = args.begin(); it != args.end(); ++ it )
{
cmSystemTools::ChangeDirectory(cwd.c_str());
- std::string fname = cwd;
- fname += "/";
- fname += *it;
+ std::string fname;
- //sanity check on relative path; if not, try absolute path
- if ( !cmSystemTools::FileIsDirectory(fname.c_str()))
+ if(cmSystemTools::FileIsFullPath(it->c_str()))
{
fname = *it;
}
+ else
+ {
+ fname = cwd;
+ fname += "/";
+ fname += *it;
+ }
- if ( !cmSystemTools::FileExists(fname.c_str()) )
+ if ( !cmSystemTools::FileIsDirectory(fname.c_str()) )
{
// No subdirectory? So what...
continue;