diff options
author | Brad King <brad.king@kitware.com> | 2014-05-15 13:44:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-05-15 14:26:30 (GMT) |
commit | f52b5ae3c4a87723f90f63249a979424aaf99407 (patch) | |
tree | 415fe0d6b9ec6177377ff50fdd572660e5e5a7ef /Source/CTest | |
parent | a9ae1d7a605333f0dea6d709e27a177b19f8c2ae (diff) | |
download | CMake-f52b5ae3c4a87723f90f63249a979424aaf99407.zip CMake-f52b5ae3c4a87723f90f63249a979424aaf99407.tar.gz CMake-f52b5ae3c4a87723f90f63249a979424aaf99407.tar.bz2 |
cmSystemTools: Add callback for Stderr
Factor a common callback type out of StdoutCallback. Add an equivalent
StderrCallback. While at it, use "size_t" for the data length instead
of "int".
Teach "ctest --build-and-test" to capture the Stderr callback because
output sent through it is part of the logical CMake process output.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 6756dbf..b4818be 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -156,7 +156,7 @@ void CMakeProgressCallback(const char*msg, float , void * s) } //---------------------------------------------------------------------- -void CMakeStdoutCallback(const char* m, int len, void* s) +void CMakeOutputCallback(const char* m, size_t len, void* s) { std::string* out = (std::string*)s; out->append(m, len); @@ -170,12 +170,14 @@ public: cmCTestBuildAndTestCaptureRAII(cmake& cm, std::string& s): CM(cm) { cmSystemTools::SetMessageCallback(CMakeMessageCallback, &s); - cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &s); + cmSystemTools::SetStdoutCallback(CMakeOutputCallback, &s); + cmSystemTools::SetStderrCallback(CMakeOutputCallback, &s); this->CM.SetProgressCallback(CMakeProgressCallback, &s); } ~cmCTestBuildAndTestCaptureRAII() { this->CM.SetProgressCallback(0, 0); + cmSystemTools::SetStderrCallback(0, 0); cmSystemTools::SetStdoutCallback(0, 0); cmSystemTools::SetMessageCallback(0, 0); } |