BUG: Try to fix the problem of bad test names
This commit is contained in:
parent
87ef95c715
commit
12cc89a8e5
|
@ -24,22 +24,26 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
|
|||
if ( this->Values[ct_BUILD] )
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("BuildDirectory",
|
||||
this->Values[ct_BUILD]);
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Values[ct_BUILD]).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("BuildDirectory",
|
||||
this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY"));
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY")).c_str());
|
||||
}
|
||||
if ( this->Values[ct_SOURCE] )
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||
this->Values[ct_SOURCE]);
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Values[ct_SOURCE]).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY"));
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
|
||||
}
|
||||
if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() )
|
||||
{
|
||||
|
|
|
@ -58,24 +58,28 @@ bool cmCTestHandlerCommand::InitialPass(
|
|||
if ( this->Values[ct_BUILD] )
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("BuildDirectory",
|
||||
this->Values[ct_BUILD]);
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Values[ct_BUILD]).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("BuildDirectory",
|
||||
this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY"));
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY")).c_str());
|
||||
}
|
||||
if ( this->Values[ct_SOURCE] )
|
||||
{
|
||||
cmCTestLog(this->CTest, DEBUG,
|
||||
"Set source directory to: " << this->Values[ct_SOURCE] << std::endl);
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||
this->Values[ct_SOURCE]);
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Values[ct_SOURCE]).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY"));
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
|
||||
}
|
||||
if ( this->Values[ct_SUBMIT_INDEX] )
|
||||
{
|
||||
|
|
|
@ -77,8 +77,10 @@ bool cmCTestStartCommand::InitialPass(
|
|||
return false;
|
||||
}
|
||||
this->CTest->EmptyCTestConfiguration();
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory", src_dir);
|
||||
this->CTest->SetCTestConfiguration("BuildDirectory", bld_dir);
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||
cmSystemTools::CollapseFullPath(src_dir).c_str());
|
||||
this->CTest->SetCTestConfiguration("BuildDirectory",
|
||||
cmSystemTools::CollapseFullPath(bld_dir).c_str());
|
||||
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with model "
|
||||
<< smodel << std::endl
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
//----------------------------------------------------------------------
|
||||
bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args)
|
||||
{
|
||||
#undef cout
|
||||
if(args.size() < 1 )
|
||||
{
|
||||
this->SetError("called with incorrect number of arguments");
|
||||
|
@ -79,9 +80,11 @@ bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args)
|
|||
}
|
||||
std::vector<std::string>::const_iterator it;
|
||||
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
|
||||
std::cout << __LINE__ << " Current directory: " << cwd.c_str() << std::endl;
|
||||
for ( it = args.begin(); it != args.end(); ++ it )
|
||||
{
|
||||
cmSystemTools::ChangeDirectory(cwd.c_str());
|
||||
std::cout << __LINE__ << " Current directory: " << cwd.c_str() << std::endl;
|
||||
std::string fname = cwd;
|
||||
fname += "/";
|
||||
fname += *it;
|
||||
|
@ -92,6 +95,7 @@ bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args)
|
|||
continue;
|
||||
}
|
||||
cmSystemTools::ChangeDirectory(fname.c_str());
|
||||
std::cout << __LINE__ << " Current directory: " << fname.c_str() << std::endl;
|
||||
const char* testFilename;
|
||||
if( cmSystemTools::FileExists("CTestTestfile.cmake") )
|
||||
{
|
||||
|
@ -1655,6 +1659,7 @@ bool cmCTestTestHandler::SetTestsProperties(
|
|||
bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
|
||||
{
|
||||
const std::string& testname = args[0];
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE, "Add test: " << args[0] << std::endl);
|
||||
if (this->UseExcludeRegExpFlag &&
|
||||
this->UseExcludeRegExpFirst &&
|
||||
this->ExcludeTestsRegularExpression.find(testname.c_str()))
|
||||
|
@ -1706,6 +1711,8 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
|
|||
test.Name = testname;
|
||||
test.Args = args;
|
||||
test.Directory = cmSystemTools::GetCurrentWorkingDirectory();
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE, "Set test directory: " << test.Directory << std::endl);
|
||||
|
||||
test.IsInBasedOnREOptions = true;
|
||||
test.WillFail = false;
|
||||
if (this->UseIncludeRegExpFlag &&
|
||||
|
|
|
@ -24,12 +24,14 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
|
|||
if ( this->Values[ct_SOURCE] )
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||
this->Values[ct_SOURCE]);
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Values[ct_SOURCE]).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->CTest->SetCTestConfiguration("SourceDirectory",
|
||||
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY"));
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
|
||||
}
|
||||
std::string source_dir
|
||||
= this->CTest->GetCTestConfiguration("SourceDirectory");
|
||||
|
|
|
@ -2056,8 +2056,11 @@ void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
|
|||
std::string cmCTest::GetShortPathToFile(const char* cfname)
|
||||
{
|
||||
const std::string& sourceDir
|
||||
= this->GetCTestConfiguration("SourceDirectory");
|
||||
const std::string& buildDir = this->GetCTestConfiguration("BuildDirectory");
|
||||
= cmSystemTools::CollapseFullPath(
|
||||
this->GetCTestConfiguration("SourceDirectory"));
|
||||
const std::string& buildDir
|
||||
= cmSystemTools::CollapseFullPath(
|
||||
this->GetCTestConfiguration("BuildDirectory"));
|
||||
std::string fname = cmSystemTools::CollapseFullPath(cfname);
|
||||
|
||||
// Find relative paths to both directories
|
||||
|
|
Loading…
Reference in New Issue