diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 8026c5ab0..580623e93 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1090,16 +1090,6 @@ void cmCTestTestHandler { // no config specified to try some options tempPath = filepath; - tempPath += "Deployment/"; - tempPath += filename; - attempted.push_back(tempPath); - attemptedConfigs.push_back("Deployment"); - tempPath = filepath; - tempPath += "Development/"; - tempPath += filename; - attempted.push_back(tempPath); - attemptedConfigs.push_back("Deployment"); - tempPath = filepath; tempPath += "Release/"; tempPath += filename; attempted.push_back(tempPath); @@ -1119,6 +1109,16 @@ void cmCTestTestHandler tempPath += filename; attempted.push_back(tempPath); attemptedConfigs.push_back("RelWithDebInfo"); + tempPath = filepath; + tempPath += "Deployment/"; + tempPath += filename; + attempted.push_back(tempPath); + attemptedConfigs.push_back("Deployment"); + tempPath = filepath; + tempPath += "Development/"; + tempPath += filename; + attempted.push_back(tempPath); + attemptedConfigs.push_back("Deployment"); } } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 84b23d1f1..8158257c9 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1898,14 +1898,6 @@ int cmCTest::Run(std::vector &args, std::string* output) } // the close of the for argument loop - // default to the build type of ctest itself if there is one -#ifdef CMAKE_INTDIR - if(this->ConfigType.size() == 0) - { - this->SetConfigType(CMAKE_INTDIR); - } -#endif - // now what sould cmake do? if --build-and-test was specified then // we run the build and test handler and return if(cmakeAndTest) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 337e60fff..7e597241c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1976,3 +1976,20 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line, } } +void cmSystemTools::DoNotInheritStdPipes() +{ + { + HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); + DuplicateHandle(GetCurrentProcess(), out, + GetCurrentProcess(), &out, 0, FALSE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + SetStdHandle(STD_OUTPUT_HANDLE, out); + } + { + HANDLE out = GetStdHandle(STD_ERROR_HANDLE); + DuplicateHandle(GetCurrentProcess(), out, + GetCurrentProcess(), &out, 0, FALSE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); + SetStdHandle(STD_ERROR_HANDLE, out); + } +} diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 0cba39c02..ed95bdf88 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -339,6 +339,12 @@ public: static bool ExtractTar(const char* inFileName, const std::vector& files, bool gzip, bool verbose); + // This should be called first thing in main + // it will keep child processes from inheriting the + // stdin and stdout of this process. This is important + // if you want to be able to kill child processes and + // not get stuck waiting for all the output on the pipes. + static void DoNotInheritStdPipes(); private: static bool s_ForceUnixPaths; static bool s_RunCommandHideConsole; diff --git a/Source/ctest.cxx b/Source/ctest.cxx index b7d207fa7..5dedcc4ed 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -22,7 +22,6 @@ #include "cmDocumentation.h" #include "CTest/cmCTestScriptHandler.h" - //---------------------------------------------------------------------------- static const cmDocumentationEntry cmDocumentationName[] = { @@ -209,6 +208,7 @@ static const cmDocumentationEntry cmDocumentationSeeAlso[] = // this is a test driver program for cmCTest. int main (int argc, char *argv[]) { + cmSystemTools::DoNotInheritStdPipes(); cmSystemTools::EnableMSVCDebugHook(); int nocwd = 0; cmCTest inst;