ENH: Refactor generation of CTestTestfile content

This moves code which generates ADD_TEST and SET_TESTS_PROPERTIES calls
into CTestTestfile.cmake files out of cmLocalGenerator and into a
cmTestGenerator class.  This will allow more advanced generation without
cluttering cmLocalGenerator.  The cmTestGenerator class derives from
cmScriptGenerator to get support for per-configuration script
generation (not yet enabled).
This commit is contained in:
Brad King
2009-03-16 10:40:46 -04:00
parent e67f5138b8
commit 66d69f864a
8 changed files with 220 additions and 81 deletions
+10 -1
View File
@@ -16,6 +16,8 @@
=========================================================================*/
#include "cmAddTestCommand.h"
#include "cmTestGenerator.h"
#include "cmTest.h"
@@ -42,7 +44,14 @@ bool cmAddTestCommand
arguments.push_back(*it);
}
cmTest* test = this->Makefile->CreateTest(args[0].c_str());
// Create the test but add a generator only the first time it is
// seen. This preserves behavior from before test generators.
cmTest* test = this->Makefile->GetTest(args[0].c_str());
if(!test)
{
test = this->Makefile->CreateTest(args[0].c_str());
this->Makefile->AddTestGenerator(new cmTestGenerator(test));
}
test->SetCommand(args[1].c_str());
test->SetArguments(arguments);