|
|
@@ -325,49 +325,9 @@ void cmCTest::Initialize()
|
|
|
{
|
|
|
m_ToplevelPath = cmSystemTools::GetCurrentWorkingDirectory();
|
|
|
cmSystemTools::ConvertToUnixSlashes(m_ToplevelPath);
|
|
|
- // parse the dart test file
|
|
|
- std::ifstream fin("DartConfiguration.tcl");
|
|
|
- if(!fin)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- char buffer[1024];
|
|
|
- while ( fin )
|
|
|
- {
|
|
|
- buffer[0] = 0;
|
|
|
- fin.getline(buffer, 1023);
|
|
|
- buffer[1023] = 0;
|
|
|
- std::string line = ::CleanString(buffer);
|
|
|
- if(line.size() == 0)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- while ( fin && (line[line.size()-1] == '\\') )
|
|
|
- {
|
|
|
- line = line.substr(0, line.size()-1);
|
|
|
- buffer[0] = 0;
|
|
|
- fin.getline(buffer, 1023);
|
|
|
- buffer[1023] = 0;
|
|
|
- line += ::CleanString(buffer);
|
|
|
- }
|
|
|
- if ( line[0] == '#' )
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- std::string::size_type cpos = line.find_first_of(":");
|
|
|
- if ( cpos == line.npos )
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- std::string key = line.substr(0, cpos);
|
|
|
- std::string value = ::CleanString(line.substr(cpos+1, line.npos));
|
|
|
- m_DartConfiguration[key] = value;
|
|
|
- }
|
|
|
- fin.close();
|
|
|
+ this->UpdateCTestConfiguration();
|
|
|
if ( m_DartMode )
|
|
|
{
|
|
|
- m_TimeOut = atoi(m_DartConfiguration["TimeOut"].c_str());
|
|
|
std::string testingDir = m_ToplevelPath + "/Testing";
|
|
|
if ( cmSystemTools::FileExists(testingDir.c_str()) )
|
|
|
{
|
|
|
@@ -392,10 +352,8 @@ void cmCTest::Initialize()
|
|
|
std::string tag;
|
|
|
time_t tctime = time(0);
|
|
|
struct tm *lctime = gmtime(&tctime);
|
|
|
- if ( tfin )
|
|
|
+ if ( tfin && cmSystemTools::GetLineFromStream(tfin, tag) )
|
|
|
{
|
|
|
- tfin >> tag;
|
|
|
- tfin.close();
|
|
|
int year = 0;
|
|
|
int mon = 0;
|
|
|
int day = 0;
|
|
|
@@ -409,7 +367,15 @@ void cmCTest::Initialize()
|
|
|
{
|
|
|
tag = "";
|
|
|
}
|
|
|
-
|
|
|
+ std::string tagmode;
|
|
|
+ if ( cmSystemTools::GetLineFromStream(tfin, tagmode) )
|
|
|
+ {
|
|
|
+ if ( tagmode.size() > 4 && !( m_Tests[cmCTest::START_TEST] || m_Tests[ALL_TEST] ))
|
|
|
+ {
|
|
|
+ m_TestModel = cmCTest::GetTestModelFromString(tagmode.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tfin.close();
|
|
|
}
|
|
|
if ( tag.size() == 0 || m_Tests[cmCTest::START_TEST] || m_Tests[ALL_TEST])
|
|
|
{
|
|
|
@@ -431,14 +397,64 @@ void cmCTest::Initialize()
|
|
|
if ( ofs )
|
|
|
{
|
|
|
ofs << tag << std::endl;
|
|
|
+ ofs << this->GetTestModelString() << std::endl;
|
|
|
}
|
|
|
ofs.close();
|
|
|
- std::cout << "Create new tag: " << tag << std::endl;
|
|
|
+ std::cout << "Create new tag: " << tag << " - "
|
|
|
+ << this->GetTestModelString() << std::endl;
|
|
|
}
|
|
|
m_CurrentTag = tag;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void cmCTest::UpdateCTestConfiguration()
|
|
|
+{
|
|
|
+ // parse the dart test file
|
|
|
+ std::ifstream fin("DartConfiguration.tcl");
|
|
|
+ if(!fin)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ char buffer[1024];
|
|
|
+ while ( fin )
|
|
|
+ {
|
|
|
+ buffer[0] = 0;
|
|
|
+ fin.getline(buffer, 1023);
|
|
|
+ buffer[1023] = 0;
|
|
|
+ std::string line = ::CleanString(buffer);
|
|
|
+ if(line.size() == 0)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ while ( fin && (line[line.size()-1] == '\\') )
|
|
|
+ {
|
|
|
+ line = line.substr(0, line.size()-1);
|
|
|
+ buffer[0] = 0;
|
|
|
+ fin.getline(buffer, 1023);
|
|
|
+ buffer[1023] = 0;
|
|
|
+ line += ::CleanString(buffer);
|
|
|
+ }
|
|
|
+ if ( line[0] == '#' )
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ std::string::size_type cpos = line.find_first_of(":");
|
|
|
+ if ( cpos == line.npos )
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ std::string key = line.substr(0, cpos);
|
|
|
+ std::string value = ::CleanString(line.substr(cpos+1, line.npos));
|
|
|
+ m_DartConfiguration[key] = value;
|
|
|
+ }
|
|
|
+ fin.close();
|
|
|
+ if ( m_DartMode )
|
|
|
+ {
|
|
|
+ m_TimeOut = atoi(m_DartConfiguration["TimeOut"].c_str());
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
bool cmCTest::SetTest(const char* ttype)
|
|
|
{
|
|
|
if ( cmSystemTools::LowerCase(ttype) == "all" )
|
|
|
@@ -636,7 +652,7 @@ int cmCTest::UpdateDirectory()
|
|
|
}
|
|
|
|
|
|
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
|
|
- << "<Update mode=\"Client\">\n"
|
|
|
+ << "<Update mode=\"Client\" Generator=\"ctest\">\n"
|
|
|
<< "\t<Site>" <<m_DartConfiguration["Site"] << "</Site>\n"
|
|
|
<< "\t<BuildName>" << m_DartConfiguration["BuildName"]
|
|
|
<< "</BuildName>\n"
|
|
|
@@ -2485,6 +2501,7 @@ int cmCTest::ProcessTests()
|
|
|
}
|
|
|
if ( m_Tests[BUILD_TEST] || m_Tests[ALL_TEST] )
|
|
|
{
|
|
|
+ this->UpdateCTestConfiguration();
|
|
|
if (this->BuildDirectory())
|
|
|
{
|
|
|
res |= CTEST_BUILD_ERRORS;
|
|
|
@@ -2492,6 +2509,7 @@ int cmCTest::ProcessTests()
|
|
|
}
|
|
|
if ( m_Tests[TEST_TEST] || m_Tests[ALL_TEST] || notest )
|
|
|
{
|
|
|
+ this->UpdateCTestConfiguration();
|
|
|
if (this->TestDirectory(false))
|
|
|
{
|
|
|
res |= CTEST_TEST_ERRORS;
|
|
|
@@ -2499,17 +2517,28 @@ int cmCTest::ProcessTests()
|
|
|
}
|
|
|
if ( m_Tests[COVERAGE_TEST] || m_Tests[ALL_TEST] )
|
|
|
{
|
|
|
+ this->UpdateCTestConfiguration();
|
|
|
this->CoverageDirectory();
|
|
|
}
|
|
|
if ( m_Tests[MEMCHECK_TEST] || m_Tests[ALL_TEST] )
|
|
|
{
|
|
|
+ this->UpdateCTestConfiguration();
|
|
|
if (this->TestDirectory(true))
|
|
|
{
|
|
|
res |= CTEST_MEMORY_ERRORS;
|
|
|
}
|
|
|
}
|
|
|
+ if ( m_Tests[NOTES_TEST] || m_Tests[ALL_TEST] )
|
|
|
+ {
|
|
|
+ this->UpdateCTestConfiguration();
|
|
|
+ if ( m_NotesFiles.size() )
|
|
|
+ {
|
|
|
+ this->GenerateNotesFile(m_NotesFiles.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
if ( m_Tests[SUBMIT_TEST] || m_Tests[ALL_TEST] )
|
|
|
{
|
|
|
+ this->UpdateCTestConfiguration();
|
|
|
this->SubmitResults();
|
|
|
}
|
|
|
return res;
|
|
|
@@ -2527,6 +2556,24 @@ std::string cmCTest::GetTestModelString()
|
|
|
return "Experimental";
|
|
|
}
|
|
|
|
|
|
+int cmCTest::GetTestModelFromString(const char* str)
|
|
|
+{
|
|
|
+ if ( !str )
|
|
|
+ {
|
|
|
+ return cmCTest::EXPERIMENTAL;
|
|
|
+ }
|
|
|
+ std::string rstr = cmSystemTools::LowerCase(str);
|
|
|
+ if ( strncmp(rstr.c_str(), "cont", 4) == 0 )
|
|
|
+ {
|
|
|
+ return cmCTest::CONTINUOUS;
|
|
|
+ }
|
|
|
+ if ( strncmp(rstr.c_str(), "nigh", 4) == 0 )
|
|
|
+ {
|
|
|
+ return cmCTest::NIGHTLY;
|
|
|
+ }
|
|
|
+ return cmCTest::EXPERIMENTAL;
|
|
|
+}
|
|
|
+
|
|
|
#define SPACE_REGEX "[ \t\r\n]"
|
|
|
|
|
|
std::string cmCTest::GenerateRegressionImages(const std::string& xml)
|
|
|
@@ -3109,7 +3156,7 @@ void cmCTest::StartXML(std::ostream& ostr)
|
|
|
<< "<Site BuildName=\"" << m_DartConfiguration["BuildName"]
|
|
|
<< "\" BuildStamp=\"" << m_CurrentTag << "-"
|
|
|
<< this->GetTestModelString() << "\" Name=\""
|
|
|
- << m_DartConfiguration["Site"] << "\">" << std::endl;
|
|
|
+ << m_DartConfiguration["Site"] << "\" Generator=\"ctest\">" << std::endl;
|
|
|
}
|
|
|
|
|
|
void cmCTest::EndXML(std::ostream& ostr)
|
|
|
@@ -3288,7 +3335,7 @@ int cmCTest::GenerateDartNotesOutput(std::ostream& os, const cmCTest::tm_VectorO
|
|
|
<< "<?xml-stylesheet type=\"text/xsl\" href=\"Dart/Source/Server/XSL/Build.xsl <file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
|
|
|
<< "<Site BuildName=\"" << m_DartConfiguration["BuildName"] << "\" BuildStamp=\""
|
|
|
<< m_CurrentTag << "-" << this->GetTestModelString() << "\" Name=\""
|
|
|
- << m_DartConfiguration["Site"] << "\">\n"
|
|
|
+ << m_DartConfiguration["Site"] << "\" Generator=\"ctest\">\n"
|
|
|
<< "<Notes>" << std::endl;
|
|
|
|
|
|
for ( it = files.begin(); it != files.end(); it ++ )
|
|
|
@@ -3349,3 +3396,12 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+void cmCTest::SetNotesFiles(const char* notes)
|
|
|
+{
|
|
|
+ if ( !notes )
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ m_NotesFiles = notes;
|
|
|
+}
|
|
|
+
|