From 1b6e55933be7c8ed114994cfdb7cb9eb85f854a1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Feb 2006 11:47:18 -0500 Subject: ENH: Strengthened EXECUTE_PROCESS output check test. --- Tests/Complex/CMakeLists.txt | 8 ++++---- Tests/ComplexOneConfig/CMakeLists.txt | 8 ++++---- Tests/ComplexRelativePaths/CMakeLists.txt | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index f51708e..a8437c2 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -145,10 +145,10 @@ EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -IF("${TEST_OUT}" MATCHES "ABCDEFG") -ELSE("${TEST_OUT}" MATCHES "ABCDEFG") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed") -ENDIF("${TEST_OUT}" MATCHES "ABCDEFG") +IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") + MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") +ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" COMMAND /process/does/not/exist diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index f51708e..a8437c2 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -145,10 +145,10 @@ EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -IF("${TEST_OUT}" MATCHES "ABCDEFG") -ELSE("${TEST_OUT}" MATCHES "ABCDEFG") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed") -ENDIF("${TEST_OUT}" MATCHES "ABCDEFG") +IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") + MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") +ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" COMMAND /process/does/not/exist diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt index f51708e..a8437c2 100644 --- a/Tests/ComplexRelativePaths/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/CMakeLists.txt @@ -145,10 +145,10 @@ EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -IF("${TEST_OUT}" MATCHES "ABCDEFG") -ELSE("${TEST_OUT}" MATCHES "ABCDEFG") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed") -ENDIF("${TEST_OUT}" MATCHES "ABCDEFG") +IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") + MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") +ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" COMMAND /process/does/not/exist -- cgit v0.12