diff options
Diffstat (limited to 'Tests')
9 files changed, 67 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt new file mode 100644 index 0000000..c20fd86 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt @@ -0,0 +1 @@ +^[^0] diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt new file mode 100644 index 0000000..87e5384 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt @@ -0,0 +1,8 @@ +( )?-- stdout output is: +( )?This is some dummy output with some long lines to ensure formatting is preserved +( )? Including lines with leading spaces +( )? +( )?And also blank lines[ + ]+ +( )?-- stderr output is: +( )?cmake -E env: no command given diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake new file mode 100644 index 0000000..863bbef --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake @@ -0,0 +1,20 @@ +include(ExternalProject) + +set(dummyOutput [[ +This is some dummy output with some long lines to ensure formatting is preserved + Including lines with leading spaces + +And also blank lines +]]) + +ExternalProject_Add(FailsWithOutput + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} + CONFIGURE_COMMAND "" + BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput} + COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail + TEST_COMMAND "" + INSTALL_COMMAND "" + LOG_BUILD YES + LOG_OUTPUT_ON_FAILURE YES + USES_TERMINAL_BUILD YES +) diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt new file mode 100644 index 0000000..c20fd86 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt @@ -0,0 +1 @@ +^[^0] diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt new file mode 100644 index 0000000..11c7317 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt @@ -0,0 +1,7 @@ +( )?-- Log output is: +( )?This is some dummy output with some long lines to ensure formatting is preserved +( )? Including lines with leading spaces +( )? +( )?And also blank lines[ + ]+ +( )?cmake -E env: no command given diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake new file mode 100644 index 0000000..116448b --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake @@ -0,0 +1,21 @@ +include(ExternalProject) + +set(dummyOutput [[ +This is some dummy output with some long lines to ensure formatting is preserved + Including lines with leading spaces + +And also blank lines +]]) + +ExternalProject_Add(FailsWithOutput + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} + CONFIGURE_COMMAND "" + BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput} + COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail + TEST_COMMAND "" + INSTALL_COMMAND "" + LOG_BUILD YES + LOG_OUTPUT_ON_FAILURE YES + LOG_MERGED_STDOUTERR YES + USES_TERMINAL_BUILD YES +) diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake index bf11381..caaf0d2 100644 --- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake @@ -29,6 +29,13 @@ endfunction() __ep_test_with_build(MultiCommand) +# Output is not predictable enough to be able to verify it reliably +# when using the various different Visual Studio generators +if(NOT RunCMake_GENERATOR MATCHES "Visual Studio") + __ep_test_with_build(LogOutputOnFailure) + __ep_test_with_build(LogOutputOnFailureMerged) +endif() + # We can't test the substitution when using the old MSYS due to # make/sh mangling the paths (substitution is performed correctly, # but the mangling means we can't reliably test the output). |