Add file-driven image import automation

This commit is contained in:
2026-06-02 10:04:48 +02:00
parent 3701fd2a71
commit b0445382dd
5 changed files with 196 additions and 3 deletions

View File

@@ -262,6 +262,15 @@ if(TARGET pano_cli)
LABELS "assets;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"format\":\"png\".*\"width\":320.*\"height\":240.*\"components\":4.*\"colorType\":\"rgba\"")
add_test(NAME pano_cli_import_image_rejects_truncated_png
COMMAND "${CMAKE_COMMAND}"
-DPANO_CLI=$<TARGET_FILE:pano_cli>
-DIMAGE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/data/images/tiny-rgba-header.png
"-DEXPECTED_OUTPUT=PNG payload could not be decoded"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/expect_pano_cli_import_image_failure.cmake")
set_tests_properties(pano_cli_import_image_rejects_truncated_png PROPERTIES
LABELS "assets;document;integration;desktop-fast")
add_test(NAME pano_cli_inspect_project_layout_smoke
COMMAND pano_cli inspect-project --path "${CMAKE_CURRENT_SOURCE_DIR}/data/projects/minimal-project.ppi")
set_tests_properties(pano_cli_inspect_project_layout_smoke PROPERTIES

View File

@@ -0,0 +1,28 @@
if(NOT DEFINED PANO_CLI)
message(FATAL_ERROR "PANO_CLI must be set")
endif()
if(NOT DEFINED IMAGE_PATH)
message(FATAL_ERROR "IMAGE_PATH must be set")
endif()
if(NOT DEFINED EXPECTED_OUTPUT)
message(FATAL_ERROR "EXPECTED_OUTPUT must be set")
endif()
execute_process(
COMMAND "${PANO_CLI}" import-image --path "${IMAGE_PATH}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error)
if(result EQUAL 0)
message(FATAL_ERROR "Expected pano_cli import-image to fail, but it exited 0")
endif()
set(combined_output "${output}${error}")
string(FIND "${combined_output}" "${EXPECTED_OUTPUT}" expected_index)
if(expected_index LESS 0)
message(FATAL_ERROR
"Expected output to contain '${EXPECTED_OUTPUT}', got: ${combined_output}")
endif()