ENH: Properly propagate config type to test

This commit is contained in:
Andy Cedilnik 2006-10-13 17:10:48 -04:00
parent 655ba54e2d
commit 3206db15b3
3 changed files with 16 additions and 10 deletions

View File

@ -1546,14 +1546,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
i < args.size() - 1) i < args.size() - 1)
{ {
i++; i++;
this->ConfigType = args[i]; this->SetConfigType(args[i].c_str());
cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
if ( !this->ConfigType.empty() )
{
std::string confTypeEnv
= "CMAKE_CONFIG_TYPE=" + this->ConfigType;
cmSystemTools::PutEnv(confTypeEnv.c_str());
}
} }
if(this->CheckArgument(arg, "--debug")) if(this->CheckArgument(arg, "--debug"))
@ -1848,7 +1841,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
#ifdef CMAKE_INTDIR #ifdef CMAKE_INTDIR
if(this->ConfigType.size() == 0) if(this->ConfigType.size() == 0)
{ {
this->ConfigType = CMAKE_INTDIR; this->SetConfigType(CMAKE_INTDIR);
} }
#endif #endif
@ -2292,6 +2285,16 @@ void cmCTest::AddCTestConfigurationOverwrite(const char* encstr)
this->CTestConfigurationOverwrites[key] = value; this->CTestConfigurationOverwrites[key] = value;
} }
//----------------------------------------------------------------------
void cmCTest::SetConfigType(const char* ct)
{
this->ConfigType = ct?ct:"";
cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
std::string confTypeEnv
= "CMAKE_CONFIG_TYPE=" + this->ConfigType;
cmSystemTools::PutEnv(confTypeEnv.c_str());
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
const char* dconfig, const char* cmake_var) const char* dconfig, const char* cmake_var)

View File

@ -269,6 +269,9 @@ public:
//! Set the output log file name //! Set the output log file name
void SetOutputLogFileName(const char* name); void SetOutputLogFileName(const char* name);
//! Set the visual studio or Xcode config type
void SetConfigType(const char* ct);
//! Various log types //! Various log types
enum { enum {
DEBUG = 0, DEBUG = 0,

View File

@ -9,7 +9,7 @@ SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Source/kwsys")
SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin") SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin")
SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CTEST_BUILD_CONFIGURATION "Release") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")