ENH: Some more generalization

This commit is contained in:
Andy Cedilnik 2005-02-17 16:11:10 -05:00
parent 79a7f42a21
commit d5aafe1b93
2 changed files with 28 additions and 17 deletions

View File

@ -199,6 +199,23 @@ int cmCTestTestHandler::PostProcessHandler()
//functions and commented... //functions and commented...
int cmCTestTestHandler::ProcessHandler() int cmCTestTestHandler::ProcessHandler()
{ {
// Update internal data structure from generic one
this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation"));
this->SetUseUnion(cmSystemTools::IsOn(this->GetOption("UseUnion")));
const char* val;
val = this->GetOption("IncludeRegularExpression");
if ( val )
{
this->UseIncludeRegExp();
this->SetIncludeRegExp(val);
}
val = this->GetOption("ExcludeRegularExpression");
if ( val )
{
this->UseExcludeRegExp();
this->SetExcludeRegExp(val);
}
m_TestResults.clear(); m_TestResults.clear();
std::cout << (m_MemCheck ? "Memory check" : "Test") << " project" << std::endl; std::cout << (m_MemCheck ? "Memory check" : "Test") << " project" << std::endl;

View File

@ -768,7 +768,7 @@ int cmCTest::ProcessTests()
} }
if ( m_Tests[CONFIGURE_TEST] || m_Tests[ALL_TEST] ) if ( m_Tests[CONFIGURE_TEST] || m_Tests[ALL_TEST] )
{ {
if (m_TestingHandlers["configure"]->ProcessHandler() < 0) if (this->GetHandler("configure")->ProcessHandler() < 0)
{ {
res |= cmCTest::CONFIGURE_ERRORS; res |= cmCTest::CONFIGURE_ERRORS;
} }
@ -776,7 +776,7 @@ int cmCTest::ProcessTests()
if ( m_Tests[BUILD_TEST] || m_Tests[ALL_TEST] ) if ( m_Tests[BUILD_TEST] || m_Tests[ALL_TEST] )
{ {
this->UpdateCTestConfiguration(); this->UpdateCTestConfiguration();
if (m_TestingHandlers["build"]->ProcessHandler() < 0) if (this->GetHandler("build")->ProcessHandler() < 0)
{ {
res |= cmCTest::BUILD_ERRORS; res |= cmCTest::BUILD_ERRORS;
} }
@ -784,7 +784,7 @@ int cmCTest::ProcessTests()
if ( m_Tests[TEST_TEST] || m_Tests[ALL_TEST] || notest ) if ( m_Tests[TEST_TEST] || m_Tests[ALL_TEST] || notest )
{ {
this->UpdateCTestConfiguration(); this->UpdateCTestConfiguration();
if (m_TestingHandlers["test"]->ProcessHandler() < 0) if (this->GetHandler("test")->ProcessHandler() < 0)
{ {
res |= cmCTest::TEST_ERRORS; res |= cmCTest::TEST_ERRORS;
} }
@ -792,7 +792,7 @@ int cmCTest::ProcessTests()
if ( m_Tests[COVERAGE_TEST] || m_Tests[ALL_TEST] ) if ( m_Tests[COVERAGE_TEST] || m_Tests[ALL_TEST] )
{ {
this->UpdateCTestConfiguration(); this->UpdateCTestConfiguration();
if (m_TestingHandlers["coverage"]->ProcessHandler() < 0) if (this->GetHandler("coverage")->ProcessHandler() < 0)
{ {
res |= cmCTest::COVERAGE_ERRORS; res |= cmCTest::COVERAGE_ERRORS;
} }
@ -800,7 +800,7 @@ int cmCTest::ProcessTests()
if ( m_Tests[MEMCHECK_TEST] || m_Tests[ALL_TEST] ) if ( m_Tests[MEMCHECK_TEST] || m_Tests[ALL_TEST] )
{ {
this->UpdateCTestConfiguration(); this->UpdateCTestConfiguration();
if (m_TestingHandlers["memcheck"]->ProcessHandler() < 0) if (this->GetHandler("memcheck")->ProcessHandler() < 0)
{ {
res |= cmCTest::MEMORY_ERRORS; res |= cmCTest::MEMORY_ERRORS;
} }
@ -1226,7 +1226,7 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
{ {
this->m_RunConfigurationScript = true; this->m_RunConfigurationScript = true;
i++; i++;
cmCTestScriptHandler* ch = static_cast<cmCTestScriptHandler*>(m_TestingHandlers["script"]); cmCTestScriptHandler* ch = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
ch->AddConfigurationScript(args[i].c_str()); ch->AddConfigurationScript(args[i].c_str());
} }
@ -1497,28 +1497,22 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
if(arg.find("-I",0) == 0 && i < args.size() - 1) if(arg.find("-I",0) == 0 && i < args.size() - 1)
{ {
i++; i++;
cmCTestTestHandler* th = static_cast<cmCTestTestHandler*>(m_TestingHandlers["test"]); this->GetHandler("test")->SetOption("TestsToRunInformation", args[i].c_str());
th->SetTestsToRunInformation(args[i].c_str());
} }
if(arg.find("-U",0) == 0) if(arg.find("-U",0) == 0)
{ {
cmCTestTestHandler* th = static_cast<cmCTestTestHandler*>(m_TestingHandlers["test"]); this->GetHandler("test")->SetOption("UseUnion", "true");
th->SetUseUnion(true);
} }
if(arg.find("-R",0) == 0 && i < args.size() - 1) if(arg.find("-R",0) == 0 && i < args.size() - 1)
{ {
cmCTestTestHandler* th = static_cast<cmCTestTestHandler*>(m_TestingHandlers["test"]);
th->UseIncludeRegExp();
i++; i++;
th->SetIncludeRegExp(args[i].c_str()); this->GetHandler("test")->SetOption("IncludeRegularExpression", args[i].c_str());
} }
if(arg.find("-E",0) == 0 && i < args.size() - 1) if(arg.find("-E",0) == 0 && i < args.size() - 1)
{ {
cmCTestTestHandler* th = static_cast<cmCTestTestHandler*>(m_TestingHandlers["test"]);
th->UseExcludeRegExp();
i++; i++;
th->SetExcludeRegExp(args[i].c_str()); this->GetHandler("test")->SetOption("ExcludeRegularExpression", args[i].c_str());
} }
if(arg.find("-A",0) == 0 && i < args.size() - 1) if(arg.find("-A",0) == 0 && i < args.size() - 1)
@ -1640,7 +1634,7 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
// call process directory // call process directory
if (this->m_RunConfigurationScript) if (this->m_RunConfigurationScript)
{ {
res = m_TestingHandlers["script"]->ProcessHandler(); res = this->GetHandler("script")->ProcessHandler();
} }
else else
{ {