Expose app document routing in pano cli
This commit is contained in:
27
tests/cmake/expect_pano_cli_classify_open_failure.cmake
Normal file
27
tests/cmake/expect_pano_cli_classify_open_failure.cmake
Normal file
@@ -0,0 +1,27 @@
|
||||
if(NOT DEFINED PANO_CLI)
|
||||
message(FATAL_ERROR "PANO_CLI is required")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED OPEN_PATH)
|
||||
message(FATAL_ERROR "OPEN_PATH is required")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED EXPECTED_OUTPUT)
|
||||
message(FATAL_ERROR "EXPECTED_OUTPUT is required")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${PANO_CLI}" classify-open --path "${OPEN_PATH}"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE error)
|
||||
|
||||
if(result EQUAL 0)
|
||||
message(FATAL_ERROR "pano_cli classify-open unexpectedly succeeded: ${output}${error}")
|
||||
endif()
|
||||
|
||||
string(FIND "${output}${error}" "${EXPECTED_OUTPUT}" found_at)
|
||||
if(found_at EQUAL -1)
|
||||
message(FATAL_ERROR
|
||||
"pano_cli classify-open failure output did not contain expected text.\nExpected: ${EXPECTED_OUTPUT}\nOutput: ${output}${error}")
|
||||
endif()
|
||||
Reference in New Issue
Block a user