summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-03-17 16:30:47 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-03-17 16:30:47 (GMT)
commit157b2399054d8893ad758ad04c8f7a576a358478 (patch)
tree424cb7ad4cb3c43cfb691085462507c7219db230 /Source/cmCTest.cxx
parentec3a119480de133849b28b6c98f9953793fb92cc (diff)
downloadCMake-157b2399054d8893ad758ad04c8f7a576a358478.zip
CMake-157b2399054d8893ad758ad04c8f7a576a358478.tar.gz
CMake-157b2399054d8893ad758ad04c8f7a576a358478.tar.bz2
BUG: change directory before running test and remember test number
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index fc111d4..d56144d 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1948,9 +1948,9 @@ void cmCTest::GetListOfTests(tm_ListOfTests* testlist, bool memcheck)
}
cmCTestTestProperties test;
- test.Name = testname;
- test.Args = args;
- test.Directory = cmSystemTools::GetCurrentWorkingDirectory();
+ test.m_Name = testname;
+ test.m_Args = args;
+ test.m_Directory = cmSystemTools::GetCurrentWorkingDirectory();
testlist->push_back(test);
}
}
@@ -1960,6 +1960,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
cmCTest::tm_VectorOfStrings &failed,
bool memcheck)
{
+ std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmsys::RegularExpression dartStuff("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
tm_ListOfTests testlist;
this->GetListOfTests(&testlist, memcheck);
@@ -1989,19 +1990,21 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
for ( it = testlist.begin(); it != testlist.end(); it ++ )
{
cnt ++;
- const std::string& testname = it->Name;
- tm_VectorOfListFileArgs& args = it->Args;
+ const std::string& testname = it->m_Name;
+ tm_VectorOfListFileArgs& args = it->m_Args;
cmCTestTestResult cres;
cres.m_Status = cmCTest::NOT_RUN;
+ cres.m_TestCount = cnt;
- if (last_directory != it->Directory)
+ if (last_directory != it->m_Directory)
{
if ( m_Verbose )
{
std::cerr << "Changing directory into "
- << it->Directory.c_str() << "\n";
+ << it->m_Directory.c_str() << "\n";
}
- last_directory = it->Directory;
+ last_directory = it->m_Directory;
+ cmSystemTools::ChangeDirectory(last_directory.c_str());
}
cres.m_Name = testname;
if ( m_ShowOnly )
@@ -2085,7 +2088,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
}
*olog
<< std::endl
- << "Directory: " << it->Directory << std::endl
+ << "Directory: " << it->m_Directory << std::endl
<< "\"" << testname.c_str() << "\" start time: "
<< ::CurrentTime() << std::endl
<< "Output:" << std::endl
@@ -2207,6 +2210,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
{
*olog << "End testing: " << m_EndTest << std::endl;
}
+ cmSystemTools::ChangeDirectory(current_dir.c_str());
}
bool cmCTest::InitializeMemoryChecking()