mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 07:08:38 -05:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user