summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-25 18:38:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-01-25 18:38:17 (GMT)
commit48ab5050de1b60309744f894fd0e96b2db75b76f (patch)
treed7fadfc21bf2df30ff6ad85792a0bef1325d16ea /Tests
parentaa6ad9c903c95f7e1112d52925d217d8cb54b62f (diff)
parent4d0e2e81e9c60f6f147f3b332b1d885d543b2084 (diff)
downloadCMake-48ab5050de1b60309744f894fd0e96b2db75b76f.zip
CMake-48ab5050de1b60309744f894fd0e96b2db75b76f.tar.gz
CMake-48ab5050de1b60309744f894fd0e96b2db75b76f.tar.bz2
Merge topic 'debug-ProcessorCount'
4d0e2e8 ProcessorCount test: require SystemInformation process to work e03f83f ProcessorCount test: fix path to cmsysTestsCxx executable
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeTests/CMakeLists.txt5
-rw-r--r--Tests/CMakeTests/ProcessorCountTest.cmake.in11
2 files changed, 12 insertions, 4 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index d34d4a6..b049995 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -4,7 +4,8 @@ set(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake")
macro(AddCMakeTest TestName PreArgs)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE)
- add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs}
+ add_test(NAME CMake.${TestName}
+ COMMAND ${CMAKE_EXECUTABLE} ${PreArgs}
-P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN})
endmacro()
@@ -28,7 +29,7 @@ AddCMakeTest(String "")
AddCMakeTest(Math "")
AddCMakeTest(CMakeMinimumRequired "")
AddCMakeTest(CompilerIdVendor "")
-AddCMakeTest(ProcessorCount "")
+AddCMakeTest(ProcessorCount "-DKWSYS_TEST_EXE=$<TARGET_FILE:cmsysTestsCxx>")
AddCMakeTest(PushCheckState "")
AddCMakeTest(While "")
diff --git a/Tests/CMakeTests/ProcessorCountTest.cmake.in b/Tests/CMakeTests/ProcessorCountTest.cmake.in
index 98f6ab1..f92dcc4 100644
--- a/Tests/CMakeTests/ProcessorCountTest.cmake.in
+++ b/Tests/CMakeTests/ProcessorCountTest.cmake.in
@@ -9,10 +9,17 @@ message("### 3. ProcessorCount(...) function call is emitting output that it sho
message("processor_count='${processor_count}'")
execute_process(
- COMMAND "@CMAKE_BINARY_DIR@/Source/kwsys/$ENV{CMAKE_CONFIG_TYPE}/cmsysTestsCxx"
+ COMMAND "${KWSYS_TEST_EXE}"
testSystemInformation
OUTPUT_VARIABLE tsi_out
- ERROR_VARIABLE tsi_err)
+ ERROR_VARIABLE tsi_err
+ RESULT_VARIABLE tsi_res
+)
+if (tsi_res)
+ message("executing \"${KWSYS_TEST_EXE}\" failed")
+ message(FATAL_ERROR "output: ${tsi_res}")
+endif ()
+
string(REGEX REPLACE "(.*)GetNumberOfPhysicalCPU:.([0-9]*)(.*)" "\\2"
system_info_processor_count "${tsi_out}")