summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-02-17 20:23:00 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-02-17 20:23:00 (GMT)
commit79a7f42a218958a44158a023ba21b08f3808ec08 (patch)
tree6e1ec9b7f761dbf31b36fa18d2ed2a398d6cec46 /Source/cmCTest.cxx
parentab7668de3f952a289987dca477f6540912302430 (diff)
downloadCMake-79a7f42a218958a44158a023ba21b08f3808ec08.zip
CMake-79a7f42a218958a44158a023ba21b08f3808ec08.tar.gz
CMake-79a7f42a218958a44158a023ba21b08f3808ec08.tar.bz2
ENH: Cleanups and add CTEST_UPDATE command
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx39
1 files changed, 33 insertions, 6 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 6d3dd26..56f912f 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -368,13 +368,19 @@ int cmCTest::Initialize(const char* binary_dir)
return 1;
}
-void cmCTest::UpdateCTestConfiguration()
+bool cmCTest::UpdateCTestConfiguration()
{
+ std::string fileName = m_BinaryDir + "/DartConfiguration.tcl";
+ if ( !cmSystemTools::FileExists(fileName.c_str()) )
+ {
+ std::cerr << "Cannot find file: " << fileName.c_str() << std::endl;
+ return false;
+ }
// parse the dart test file
- std::ifstream fin("DartConfiguration.tcl");
+ std::ifstream fin(fileName.c_str());
if(!fin)
{
- return;
+ return false;
}
char buffer[1024];
@@ -415,6 +421,7 @@ void cmCTest::UpdateCTestConfiguration()
m_TimeOut = atoi(m_DartConfiguration["TimeOut"].c_str());
m_CompressXMLFiles = cmSystemTools::IsOn(m_DartConfiguration["CompressSubmission"].c_str());
}
+ return true;
}
void cmCTest::BlockTestErrorDiagnostics()
@@ -710,7 +717,25 @@ std::string cmCTest::GetSubmitResultsPrefix()
return name;
}
+cmCTestGenericHandler* cmCTest::GetHandler(const char* handler)
+{
+ cmCTest::t_TestingHandlers::iterator it = m_TestingHandlers.find(handler);
+ if ( it == m_TestingHandlers.end() )
+ {
+ return 0;
+ }
+ return it->second;
+}
+int cmCTest::ExecuteHandler(const char* shandler)
+{
+ cmCTestGenericHandler* handler = this->GetHandler(shandler);
+ if ( !handler )
+ {
+ return -1;
+ }
+ return handler->ProcessHandler();
+}
int cmCTest::ProcessTests()
{
@@ -729,7 +754,9 @@ int cmCTest::ProcessTests()
}
if ( m_Tests[UPDATE_TEST] || m_Tests[ALL_TEST] )
{
- update_count = m_TestingHandlers["update"]->ProcessHandler();
+ cmCTestGenericHandler* uphandler = this->GetHandler("update");
+ uphandler->SetOption("SourceDirectory", this->GetDartConfiguration("SourceDirectory").c_str());
+ update_count = uphandler->ProcessHandler();
if ( update_count < 0 )
{
res |= cmCTest::UPDATE_ERRORS;
@@ -2223,8 +2250,8 @@ void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
std::string cmCTest::GetShortPathToFile(const char* cfname)
{
- const std::string& sourceDir = GetDartConfiguration("SourceDirectory");
- const std::string& buildDir = GetDartConfiguration("BuildDirectory");
+ const std::string& sourceDir = this->GetDartConfiguration("SourceDirectory");
+ const std::string& buildDir = this->GetDartConfiguration("BuildDirectory");
std::string fname = cmSystemTools::CollapseFullPath(cfname);
// Find relative paths to both directories