BUG: CVS update fix. If the CVS command was not set there was no indication that something went wrong. Now it will make sure it does. Also start working on multiple configuration scripts
This commit is contained in:
parent
c6c1f70012
commit
3c832dd1b8
@ -673,11 +673,17 @@ int cmCTest::UpdateDirectory()
|
|||||||
os << "\t<StartDateTime>" << start_time << "</StartDateTime>\n"
|
os << "\t<StartDateTime>" << start_time << "</StartDateTime>\n"
|
||||||
<< "\t<UpdateCommand>" << command << "</UpdateCommand>\n"
|
<< "\t<UpdateCommand>" << command << "</UpdateCommand>\n"
|
||||||
<< "\t<UpdateReturnStatus>";
|
<< "\t<UpdateReturnStatus>";
|
||||||
if ( retVal )
|
int failed = 0;
|
||||||
|
if ( !res || retVal )
|
||||||
{
|
{
|
||||||
|
os << "Update error: ";
|
||||||
os << goutput;
|
os << goutput;
|
||||||
|
std::cerr << "Update with command: " << command << " failed" << std::endl;
|
||||||
|
failed = 1;
|
||||||
}
|
}
|
||||||
os << "</UpdateReturnStatus>" << std::endl;
|
os << "</UpdateReturnStatus>" << std::endl;
|
||||||
|
if ( !failed )
|
||||||
|
{
|
||||||
|
|
||||||
std::vector<cmStdString> lines;
|
std::vector<cmStdString> lines;
|
||||||
cmSystemTools::Split(goutput.c_str(), lines);
|
cmSystemTools::Split(goutput.c_str(), lines);
|
||||||
@ -923,6 +929,7 @@ int cmCTest::UpdateDirectory()
|
|||||||
{
|
{
|
||||||
ofs.close();
|
ofs.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! res || retVal )
|
if (! res || retVal )
|
||||||
{
|
{
|
||||||
@ -1376,7 +1383,10 @@ int cmCTest::CoverageDirectory()
|
|||||||
std::string command = coverageCommand + " -o \"" + currPath + "\" -l \"" + files[cc] + "\"";
|
std::string command = coverageCommand + " -o \"" + currPath + "\" -l \"" + files[cc] + "\"";
|
||||||
std::string output;
|
std::string output;
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
|
if ( m_Verbose )
|
||||||
|
{
|
||||||
std::cerr << "Run gcov on " << files[cc] << " in directory: " << currPath.c_str() << std::endl;
|
std::cerr << "Run gcov on " << files[cc] << " in directory: " << currPath.c_str() << std::endl;
|
||||||
|
}
|
||||||
//std::cout << " --- Run [" << command << "]" << std::endl;
|
//std::cout << " --- Run [" << command << "]" << std::endl;
|
||||||
bool res = true;
|
bool res = true;
|
||||||
if ( !m_ShowOnly )
|
if ( !m_ShowOnly )
|
||||||
@ -1450,6 +1460,8 @@ int cmCTest::CoverageDirectory()
|
|||||||
// {
|
// {
|
||||||
// std::cout << "File: " << files[cc] << std::endl;
|
// std::cout << "File: " << files[cc] << std::endl;
|
||||||
// }
|
// }
|
||||||
|
if ( missing_files.size() > 0 )
|
||||||
|
{
|
||||||
std::cout << "---------------------------------------------------------------" << std::endl;
|
std::cout << "---------------------------------------------------------------" << std::endl;
|
||||||
std::cout << "The following files were missing:" << std::endl;
|
std::cout << "The following files were missing:" << std::endl;
|
||||||
for ( cc = 0; cc < missing_files.size(); cc ++ )
|
for ( cc = 0; cc < missing_files.size(); cc ++ )
|
||||||
@ -1457,6 +1469,7 @@ int cmCTest::CoverageDirectory()
|
|||||||
std::cout << "File: " << missing_files[cc] << std::endl;
|
std::cout << "File: " << missing_files[cc] << std::endl;
|
||||||
}
|
}
|
||||||
std::cout << "---------------------------------------------------------------" << std::endl;
|
std::cout << "---------------------------------------------------------------" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
std::map<std::string, cmCTest::tm_VectorOfStrings >::iterator it;
|
std::map<std::string, cmCTest::tm_VectorOfStrings >::iterator it;
|
||||||
cmCTest::tm_CoverageMap coverageresults;
|
cmCTest::tm_CoverageMap coverageresults;
|
||||||
@ -3144,15 +3157,28 @@ void cmCTest::RestoreBackupDirectories(bool backup,
|
|||||||
|
|
||||||
int cmCTest::RunConfigurationScript()
|
int cmCTest::RunConfigurationScript()
|
||||||
{
|
{
|
||||||
m_ConfigurationScript =
|
int res = 0;
|
||||||
cmSystemTools::CollapseFullPath(m_ConfigurationScript.c_str());
|
cmCTest::tm_VectorOfStrings::iterator it;
|
||||||
|
for ( it = m_ConfigurationScripts.begin();
|
||||||
// make sure the file exists
|
it != m_ConfigurationScripts.end();
|
||||||
if (!cmSystemTools::FileExists(m_ConfigurationScript.c_str()))
|
it ++ )
|
||||||
{
|
{
|
||||||
|
res += this->RunConfigurationScript(
|
||||||
|
cmSystemTools::CollapseFullPath(it->c_str()));
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cmCTest::RunConfigurationScript(const std::string& script)
|
||||||
|
{
|
||||||
|
// make sure the file exists
|
||||||
|
if (!cmSystemTools::FileExists(script.c_str()))
|
||||||
|
{
|
||||||
|
std::cerr << "Cannot find file: " << script.c_str() << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// create a cmake instance to read the configuration script
|
// create a cmake instance to read the configuration script
|
||||||
cmake cm;
|
cmake cm;
|
||||||
cmGlobalGenerator gg;
|
cmGlobalGenerator gg;
|
||||||
@ -3165,11 +3191,11 @@ int cmCTest::RunConfigurationScript()
|
|||||||
// set a variable with the path to the current script
|
// set a variable with the path to the current script
|
||||||
lg->GetMakefile()->AddDefinition("CTEST_SCRIPT_DIRECTORY",
|
lg->GetMakefile()->AddDefinition("CTEST_SCRIPT_DIRECTORY",
|
||||||
cmSystemTools::GetFilenamePath(
|
cmSystemTools::GetFilenamePath(
|
||||||
m_ConfigurationScript).c_str());
|
script).c_str());
|
||||||
lg->GetMakefile()->AddDefinition("CTEST_SCRIPT_NAME",
|
lg->GetMakefile()->AddDefinition("CTEST_SCRIPT_NAME",
|
||||||
cmSystemTools::GetFilenameName(
|
cmSystemTools::GetFilenameName(
|
||||||
m_ConfigurationScript).c_str());
|
script).c_str());
|
||||||
if (!lg->GetMakefile()->ReadListFile(0, m_ConfigurationScript.c_str()))
|
if (!lg->GetMakefile()->ReadListFile(0, script.c_str()))
|
||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@ -3693,7 +3719,7 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
|||||||
{
|
{
|
||||||
this->m_RunConfigurationScript = true;
|
this->m_RunConfigurationScript = true;
|
||||||
i++;
|
i++;
|
||||||
this->m_ConfigurationScript = args[i];
|
this->m_ConfigurationScripts.push_back(args[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( arg.find("-D",0) == 0 && i < args.size() - 1 )
|
if( arg.find("-D",0) == 0 && i < args.size() - 1 )
|
||||||
|
@ -35,6 +35,7 @@ public:
|
|||||||
* Run a dashboard using a specified confiuration script
|
* Run a dashboard using a specified confiuration script
|
||||||
*/
|
*/
|
||||||
int RunConfigurationScript();
|
int RunConfigurationScript();
|
||||||
|
int RunConfigurationScript(const std::string& script);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize and finalize testing
|
* Initialize and finalize testing
|
||||||
@ -140,7 +141,7 @@ public:
|
|||||||
bool m_ShowOnly;
|
bool m_ShowOnly;
|
||||||
|
|
||||||
bool m_RunConfigurationScript;
|
bool m_RunConfigurationScript;
|
||||||
std::string m_ConfigurationScript;
|
tm_VectorOfStrings m_ConfigurationScripts;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
EXPERIMENTAL,
|
EXPERIMENTAL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user