ENH: Add CTEST_EXECUTABLE_NAME to CTest scripting. This way you do not have to specify ctest executable in CTEST_COMMAND, but just a variable
This commit is contained in:
parent
7350756728
commit
6e9ec4598d
|
@ -95,7 +95,7 @@ void cmCTestScriptHandler::AddConfigurationScript(const char *script)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// the generic entry point for handling scripts, this routine will run all
|
// the generic entry point for handling scripts, this routine will run all
|
||||||
// the scripts provides a -S arguments
|
// the scripts provides a -S arguments
|
||||||
int cmCTestScriptHandler::RunConfigurationScript()
|
int cmCTestScriptHandler::RunConfigurationScript(cmCTest* ctest)
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
std::vector<cmStdString>::iterator it;
|
std::vector<cmStdString>::iterator it;
|
||||||
|
@ -104,7 +104,7 @@ int cmCTestScriptHandler::RunConfigurationScript()
|
||||||
it ++ )
|
it ++ )
|
||||||
{
|
{
|
||||||
// for each script run it
|
// for each script run it
|
||||||
res += this->RunConfigurationScript(
|
res += this->RunConfigurationScript(ctest,
|
||||||
cmSystemTools::CollapseFullPath(it->c_str()));
|
cmSystemTools::CollapseFullPath(it->c_str()));
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
@ -114,7 +114,7 @@ int cmCTestScriptHandler::RunConfigurationScript()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// this sets up some variables for thew script to use, creates the required
|
// this sets up some variables for thew script to use, creates the required
|
||||||
// cmake instance and generators, and then reads in the script
|
// cmake instance and generators, and then reads in the script
|
||||||
int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
|
int cmCTestScriptHandler::ReadInScript(cmCTest* ctest, const std::string& total_script_arg)
|
||||||
{
|
{
|
||||||
// if the argument has a , in it then it needs to be broken into the fist
|
// if the argument has a , in it then it needs to be broken into the fist
|
||||||
// argument (which is the script) and the second argument which will be
|
// argument (which is the script) and the second argument which will be
|
||||||
|
@ -156,6 +156,8 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
|
||||||
m_LocalGenerator->GetMakefile()->AddDefinition("CTEST_SCRIPT_NAME",
|
m_LocalGenerator->GetMakefile()->AddDefinition("CTEST_SCRIPT_NAME",
|
||||||
cmSystemTools::GetFilenameName(
|
cmSystemTools::GetFilenameName(
|
||||||
script).c_str());
|
script).c_str());
|
||||||
|
m_LocalGenerator->GetMakefile()->AddDefinition("CTEST_EXECUTABLE_NAME",
|
||||||
|
ctest->GetCTestExecutable());
|
||||||
// add the script arg if defined
|
// add the script arg if defined
|
||||||
if (script_arg.size())
|
if (script_arg.size())
|
||||||
{
|
{
|
||||||
|
@ -277,13 +279,13 @@ void cmCTestScriptHandler::LocalSleep(unsigned int secondsToWait)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// run a specific script
|
// run a specific script
|
||||||
int cmCTestScriptHandler::RunConfigurationScript(
|
int cmCTestScriptHandler::RunConfigurationScript(cmCTest* ctest,
|
||||||
const std::string& total_script_arg)
|
const std::string& total_script_arg)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
// read in the script
|
// read in the script
|
||||||
result = this->ReadInScript(total_script_arg);
|
result = this->ReadInScript(ctest, total_script_arg);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -26,6 +26,7 @@ class cmMakefile;
|
||||||
class cmLocalGenerator;
|
class cmLocalGenerator;
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
class cmake;
|
class cmake;
|
||||||
|
class cmCTest;
|
||||||
|
|
||||||
/** \class cmCTestScriptHandler
|
/** \class cmCTestScriptHandler
|
||||||
* \brief A class that handles ctest -S invocations
|
* \brief A class that handles ctest -S invocations
|
||||||
|
@ -74,7 +75,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Run a dashboard using a specified confiuration script
|
* Run a dashboard using a specified confiuration script
|
||||||
*/
|
*/
|
||||||
int RunConfigurationScript();
|
int RunConfigurationScript(cmCTest* ctest);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If verbose then more informaiton is printed out
|
* If verbose then more informaiton is printed out
|
||||||
|
@ -86,7 +87,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// reads in a script
|
// reads in a script
|
||||||
int ReadInScript(const std::string& total_script_arg);
|
int ReadInScript(cmCTest* ctest, const std::string& total_script_arg);
|
||||||
|
|
||||||
// extract vars from the script to set ivars
|
// extract vars from the script to set ivars
|
||||||
int ExtractVariables();
|
int ExtractVariables();
|
||||||
|
@ -103,7 +104,7 @@ private:
|
||||||
int BackupDirectories();
|
int BackupDirectories();
|
||||||
void RestoreBackupDirectories();
|
void RestoreBackupDirectories();
|
||||||
|
|
||||||
int RunConfigurationScript(const std::string& script);
|
int RunConfigurationScript(cmCTest* ctest, const std::string& script);
|
||||||
int RunConfigurationDashboard();
|
int RunConfigurationDashboard();
|
||||||
|
|
||||||
std::vector<cmStdString> m_ConfigurationScripts;
|
std::vector<cmStdString> m_ConfigurationScripts;
|
||||||
|
|
|
@ -1575,7 +1575,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 = this->ScriptHandler->RunConfigurationScript();
|
res = this->ScriptHandler->RunConfigurationScript(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -179,6 +179,10 @@ public:
|
||||||
int RunTest(std::vector<const char*> args, std::string* output, int *retVal,
|
int RunTest(std::vector<const char*> args, std::string* output, int *retVal,
|
||||||
std::ostream* logfile);
|
std::ostream* logfile);
|
||||||
|
|
||||||
|
//! Get the path to CTest
|
||||||
|
const char* GetCTestExecutable() { return m_CTestSelf.c_str(); }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// these are helper classes
|
// these are helper classes
|
||||||
cmCTestBuildHandler *BuildHandler;
|
cmCTestBuildHandler *BuildHandler;
|
||||||
|
|
Loading…
Reference in New Issue