summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-04-01 19:57:55 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-04-01 19:57:55 (GMT)
commit7acfc4dc3cd8c5865ff55ed94e210776cff6876b (patch)
treef68de1f9e3885b48f37857dfaf3b5120ca93072d /Source
parenteca18a2e9fcd9a33dce6d87bcca86de236598ae1 (diff)
downloadCMake-7acfc4dc3cd8c5865ff55ed94e210776cff6876b.zip
CMake-7acfc4dc3cd8c5865ff55ed94e210776cff6876b.tar.gz
CMake-7acfc4dc3cd8c5865ff55ed94e210776cff6876b.tar.bz2
ENH: Start adding support for CTest testfiles
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx18
-rw-r--r--Source/cmAddTestCommand.cxx9
-rw-r--r--Source/cmCTest.cxx17
-rw-r--r--Source/cmCTest.h1
-rw-r--r--Source/cmEnableTestingCommand.cxx9
-rw-r--r--Source/ctest.cxx7
6 files changed, 53 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 81bd145..4c6e1da 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -798,14 +798,24 @@ std::string cmCTestTestHandler::FindTheExecutable(const char *exe)
//----------------------------------------------------------------------
void cmCTestTestHandler::GetListOfTests(tm_ListOfTests* testlist)
{
- // does the DartTestfile.txt exist ?
- if(!cmSystemTools::FileExists("DartTestfile.txt"))
+ const char* testFilename = 0;
+ if( cmSystemTools::FileExists("CTestTestfile.cmake") )
+ {
+ // does the CTestTestfile.cmake exist ?
+ testFilename = "CTestTestfile.cmake";
+ }
+ else if( cmSystemTools::FileExists("DartTestfile.txt") )
+ {
+ // does the DartTestfile.txt exist ?
+ testFilename = "DartTestfile.txt";
+ }
+ else
{
return;
}
// parse the file
- std::ifstream fin("DartTestfile.txt");
+ std::ifstream fin(testFilename);
if(!fin)
{
return;
@@ -815,7 +825,7 @@ void cmCTestTestHandler::GetListOfTests(tm_ListOfTests* testlist)
cmsys::RegularExpression ereg(this->m_ExcludeRegExp.c_str());
cmListFileCache cache;
- cmListFile* listFile = cache.GetFileCache("DartTestfile.txt", false);
+ cmListFile* listFile = cache.GetFileCache(testFilename, false);
for(std::vector<cmListFileFunction>::const_iterator f =
listFile->m_Functions.begin(); f != listFile->m_Functions.end(); ++f)
{
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 28ee2d7..66203e2 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -44,7 +44,14 @@ void cmAddTestCommand::FinalPass()
std::string fname;
fname = m_Makefile->GetStartOutputDirectory();
fname += "/";
- fname += "DartTestfile.txt";
+ if ( m_Makefile->IsOn("DART_ROOT") )
+ {
+ fname += "DartTestfile.txt";
+ }
+ else
+ {
+ fname += "CTestTestfile.cmake";
+ }
// If the file doesn't exist, then ENABLE_TESTING hasn't been run
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index e8e16a2..ed28560 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -234,6 +234,7 @@ cmCTest::cmCTest()
m_InteractiveDebugMode = true;
m_TimeOut = 0;
m_CompressXMLFiles = false;
+ m_CTestConfigFile = "";
int cc;
for ( cc=0; cc < cmCTest::LAST_TEST; cc ++ )
{
@@ -370,7 +371,15 @@ int cmCTest::Initialize(const char* binary_dir)
bool cmCTest::UpdateCTestConfiguration()
{
- std::string fileName = m_BinaryDir + "/DartConfiguration.tcl";
+ std::string fileName = m_CTestConfigFile;
+ if ( fileName.empty() )
+ {
+ fileName = m_BinaryDir + "/DartConfiguration.tcl";
+ if ( !cmSystemTools::FileExists(fileName.c_str()) )
+ {
+ fileName = m_BinaryDir + "/CTestConfiguration.tcl";
+ }
+ }
if ( !cmSystemTools::FileExists(fileName.c_str()) )
{
std::cerr << "Cannot find file: " << fileName.c_str() << std::endl;
@@ -1221,6 +1230,12 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
for(unsigned int i=1; i < args.size(); ++i)
{
std::string arg = args[i];
+ if(arg.find("--dart-config",0) == 0 && i < args.size() - 1)
+ {
+ i++;
+ this->m_CTestConfigFile= args[i];
+ }
+
if(arg.find("-C",0) == 0 && i < args.size() - 1)
{
i++;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 1837a53..6ef86b9 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -229,6 +229,7 @@ private:
//! Map of configuration properties
typedef std::map<cmStdString, cmStdString> tm_DartConfigurationMap;
+ std::string m_CTestConfigFile;
tm_DartConfigurationMap m_DartConfiguration;
int m_Tests[LAST_TEST];
diff --git a/Source/cmEnableTestingCommand.cxx b/Source/cmEnableTestingCommand.cxx
index 3662596..9a97083 100644
--- a/Source/cmEnableTestingCommand.cxx
+++ b/Source/cmEnableTestingCommand.cxx
@@ -37,7 +37,14 @@ void cmEnableTestingCommand::CreateDartTestfileForMakefile(cmMakefile *mf)
std::string fname;
fname = mf->GetStartOutputDirectory();
fname += "/";
- fname += "DartTestfile.txt";
+ if ( m_Makefile->IsOn("DART_ROOT") )
+ {
+ fname += "DartTestfile.txt";
+ }
+ else
+ {
+ fname += "CTestTestfile.cmake";
+ }
cmSystemTools::MakeDirectory(mf->GetStartOutputDirectory());
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index fee6f2a..d262570 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -138,6 +138,10 @@ static const cmDocumentationEntry cmDocumentationOptions[] =
{"--test-command", "The test to run with the --build-and-test option.", "" },
{"--tomorrow-tag", "Nightly or experimental starts with next day tag.",
"This is useful if the build will not finish in one day." },
+ {"--ctest-config", "The configuration file used to initialize CTest state when submitting dashboards.",
+ "This option tells CTest to use different initialization file instead of "
+ "DartConfiguration.tcl. This way multiple initialization files can be used "
+ "for example to submit to multiple dashboards." },
{0,0,0}
};
@@ -166,7 +170,8 @@ int main (int argc, char *argv[])
// If there is a testing input file, check for documentation options
// only if there are actually arguments. We want running without
// arguments to run tests.
- if(argc > 1 || !cmSystemTools::FileExists("DartTestfile.txt"))
+ if(argc > 1 || !cmSystemTools::FileExists("DartTestfile.txt") &&
+ !cmSystemTools::FileExists("CTestTestfile.cmake"))
{
if(argc == 1)
{