BUG: change directory before running test and remember test number
This commit is contained in:
parent
ec3a119480
commit
157b239905
@ -1948,9 +1948,9 @@ void cmCTest::GetListOfTests(tm_ListOfTests* testlist, bool memcheck)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmCTestTestProperties test;
|
cmCTestTestProperties test;
|
||||||
test.Name = testname;
|
test.m_Name = testname;
|
||||||
test.Args = args;
|
test.m_Args = args;
|
||||||
test.Directory = cmSystemTools::GetCurrentWorkingDirectory();
|
test.m_Directory = cmSystemTools::GetCurrentWorkingDirectory();
|
||||||
testlist->push_back(test);
|
testlist->push_back(test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1960,6 +1960,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
|
|||||||
cmCTest::tm_VectorOfStrings &failed,
|
cmCTest::tm_VectorOfStrings &failed,
|
||||||
bool memcheck)
|
bool memcheck)
|
||||||
{
|
{
|
||||||
|
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
|
||||||
cmsys::RegularExpression dartStuff("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
|
cmsys::RegularExpression dartStuff("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
|
||||||
tm_ListOfTests testlist;
|
tm_ListOfTests testlist;
|
||||||
this->GetListOfTests(&testlist, memcheck);
|
this->GetListOfTests(&testlist, memcheck);
|
||||||
@ -1989,19 +1990,21 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
|
|||||||
for ( it = testlist.begin(); it != testlist.end(); it ++ )
|
for ( it = testlist.begin(); it != testlist.end(); it ++ )
|
||||||
{
|
{
|
||||||
cnt ++;
|
cnt ++;
|
||||||
const std::string& testname = it->Name;
|
const std::string& testname = it->m_Name;
|
||||||
tm_VectorOfListFileArgs& args = it->Args;
|
tm_VectorOfListFileArgs& args = it->m_Args;
|
||||||
cmCTestTestResult cres;
|
cmCTestTestResult cres;
|
||||||
cres.m_Status = cmCTest::NOT_RUN;
|
cres.m_Status = cmCTest::NOT_RUN;
|
||||||
|
cres.m_TestCount = cnt;
|
||||||
|
|
||||||
if (last_directory != it->Directory)
|
if (last_directory != it->m_Directory)
|
||||||
{
|
{
|
||||||
if ( m_Verbose )
|
if ( m_Verbose )
|
||||||
{
|
{
|
||||||
std::cerr << "Changing directory into "
|
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;
|
cres.m_Name = testname;
|
||||||
if ( m_ShowOnly )
|
if ( m_ShowOnly )
|
||||||
@ -2085,7 +2088,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
|
|||||||
}
|
}
|
||||||
*olog
|
*olog
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< "Directory: " << it->Directory << std::endl
|
<< "Directory: " << it->m_Directory << std::endl
|
||||||
<< "\"" << testname.c_str() << "\" start time: "
|
<< "\"" << testname.c_str() << "\" start time: "
|
||||||
<< ::CurrentTime() << std::endl
|
<< ::CurrentTime() << std::endl
|
||||||
<< "Output:" << std::endl
|
<< "Output:" << std::endl
|
||||||
@ -2207,6 +2210,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
|
|||||||
{
|
{
|
||||||
*olog << "End testing: " << m_EndTest << std::endl;
|
*olog << "End testing: " << m_EndTest << std::endl;
|
||||||
}
|
}
|
||||||
|
cmSystemTools::ChangeDirectory(current_dir.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCTest::InitializeMemoryChecking()
|
bool cmCTest::InitializeMemoryChecking()
|
||||||
|
@ -230,6 +230,7 @@ private:
|
|||||||
std::string m_CompletionStatus;
|
std::string m_CompletionStatus;
|
||||||
std::string m_Output;
|
std::string m_Output;
|
||||||
std::string m_RegressionImages;
|
std::string m_RegressionImages;
|
||||||
|
int m_TestCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cmCTestBuildErrorWarning
|
struct cmCTestBuildErrorWarning
|
||||||
@ -246,10 +247,11 @@ private:
|
|||||||
|
|
||||||
struct cmCTestTestProperties
|
struct cmCTestTestProperties
|
||||||
{
|
{
|
||||||
cmStdString Name;
|
cmStdString m_Name;
|
||||||
cmStdString Directory;
|
cmStdString m_Directory;
|
||||||
tm_VectorOfListFileArgs Args;
|
tm_VectorOfListFileArgs m_Args;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<cmCTestTestProperties> tm_ListOfTests;
|
typedef std::vector<cmCTestTestProperties> tm_ListOfTests;
|
||||||
|
|
||||||
// Some structures needed for cvs update
|
// Some structures needed for cvs update
|
||||||
|
Loading…
x
Reference in New Issue
Block a user