Plan new document creation in app core
This commit is contained in:
26
tests/cmake/expect_pano_cli_plan_new_document_failure.cmake
Normal file
26
tests/cmake/expect_pano_cli_plan_new_document_failure.cmake
Normal file
@@ -0,0 +1,26 @@
|
||||
if(NOT DEFINED PANO_CLI)
|
||||
message(FATAL_ERROR "PANO_CLI is required")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED EXPECTED_OUTPUT)
|
||||
message(FATAL_ERROR "EXPECTED_OUTPUT is required")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${PANO_CLI}" plan-new-document
|
||||
--work-dir D:/Paint
|
||||
--name demo
|
||||
--resolution-index 99
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE error)
|
||||
|
||||
if(result EQUAL 0)
|
||||
message(FATAL_ERROR "pano_cli plan-new-document unexpectedly succeeded: ${output}${error}")
|
||||
endif()
|
||||
|
||||
string(FIND "${output}${error}" "${EXPECTED_OUTPUT}" found_at)
|
||||
if(found_at EQUAL -1)
|
||||
message(FATAL_ERROR
|
||||
"pano_cli plan-new-document failure output did not contain expected text.\nExpected: ${EXPECTED_OUTPUT}\nOutput: ${output}${error}")
|
||||
endif()
|
||||
Reference in New Issue
Block a user