27 lines
780 B
CMake
27 lines
780 B
CMake
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()
|