diff options
author | David Cole <david.cole@kitware.com> | 2011-03-18 14:28:24 -0400 |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-03-18 14:28:24 -0400 |
commit | e6c2701002a1c4620cbc58083698bd961e1ab999 (patch) | |
tree | 9d0a8cabd5a2e7c487dc9f1e5c712b26fedf7f4c /Tests/CMakeTests/ProcessorCountTest.cmake.in | |
parent | 4dd2ec2cb9dec683eafd3b303e04418c694675a3 (diff) | |
download | cmake-e6c2701002a1c4620cbc58083698bd961e1ab999.tar.gz |
ProcessorCount: Use ERROR_QUIET with execute_process (#11302)
Also, comment out all "debugging" calls to message() that helped
us interpret the output on other platforms when running on the
dashboard clients.
Using ERROR_QUIET avoids unnecessary stderr output while calling
external tools to determine the processor count. If there's an
error parsing the output, we set the count to 0 anyhow.
Also, the test will fail on a CMake dashboard run if the count
comes back equal to 0.
Now that the code is "done"-ish, remove the debugging output.
Expect no output on stdout or stderr when calling the
ProcessorCount function from now on.
Diffstat (limited to 'Tests/CMakeTests/ProcessorCountTest.cmake.in')
-rw-r--r-- | Tests/CMakeTests/ProcessorCountTest.cmake.in | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Tests/CMakeTests/ProcessorCountTest.cmake.in b/Tests/CMakeTests/ProcessorCountTest.cmake.in index c5feb315cf..98f6ab16df 100644 --- a/Tests/CMakeTests/ProcessorCountTest.cmake.in +++ b/Tests/CMakeTests/ProcessorCountTest.cmake.in @@ -1,14 +1,20 @@ include(ProcessorCount) ProcessorCount(processor_count) + +message("### 1. This line should be the first line of text in the test output.") +message("### 2. If there was output from this test before line #1, then the") +message("### 3. ProcessorCount(...) function call is emitting output that it shouldn't...") + message("processor_count='${processor_count}'") execute_process( COMMAND "@CMAKE_BINARY_DIR@/Source/kwsys/$ENV{CMAKE_CONFIG_TYPE}/cmsysTestsCxx" testSystemInformation - OUTPUT_VARIABLE out) + OUTPUT_VARIABLE tsi_out + ERROR_VARIABLE tsi_err) string(REGEX REPLACE "(.*)GetNumberOfPhysicalCPU:.([0-9]*)(.*)" "\\2" - system_info_processor_count "${out}") + system_info_processor_count "${tsi_out}") message("system_info_processor_count='${system_info_processor_count}'") @@ -19,7 +25,8 @@ endif() message("") message("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") message("") -message("out='${out}'") +message("tsi_out='${tsi_out}'") +message("tsi_err='${tsi_err}'") message("") # Evaluate possible error conditions: |