Expose app document routing in pano cli

This commit is contained in:
2026-06-02 22:16:08 +02:00
parent 0e03e5940a
commit 9dd53f9212
8 changed files with 146 additions and 13 deletions

View File

@@ -333,6 +333,34 @@ if(TARGET pano_cli)
LABELS "assets;document;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"load-project\".*\"pixelDataLoaded\":false.*\"facePayloads\":0.*\"document\":\\{\"width\":64,\"height\":32,\"layers\":1,\"frames\":1,\"animationDurationMs\":100,\"layerNames\":\\[\"Ink\"\\],\"layerFrameCounts\":\\[1\\],\"layerDurationsMs\":\\[100\\]")
add_test(NAME pano_cli_classify_open_project_smoke
COMMAND pano_cli classify-open --path "D:/Paint/Scenes/demo.ppi")
set_tests_properties(pano_cli_classify_open_project_smoke PROPERTIES
LABELS "app;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"classify-open\".*\"kind\":\"open-project\".*\"directory\":\"D:/Paint/Scenes\".*\"name\":\"demo\".*\"extension\":\"ppi\"")
add_test(NAME pano_cli_classify_open_brush_import_smoke
COMMAND pano_cli classify-open --path "D:/Paint/Brushes/clouds.ABR")
set_tests_properties(pano_cli_classify_open_brush_import_smoke PROPERTIES
LABELS "app;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"classify-open\".*\"kind\":\"import-abr\".*\"name\":\"clouds\".*\"extension\":\"abr\"")
add_test(NAME pano_cli_classify_open_ppbr_import_smoke
COMMAND pano_cli classify-open --path "D:/Paint/Brushes/palette.PpBr")
set_tests_properties(pano_cli_classify_open_ppbr_import_smoke PROPERTIES
LABELS "app;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"classify-open\".*\"kind\":\"import-ppbr\".*\"name\":\"palette\".*\"extension\":\"ppbr\"")
add_test(NAME pano_cli_classify_open_rejects_missing_directory
COMMAND "${CMAKE_COMMAND}"
-DPANO_CLI=$<TARGET_FILE:pano_cli>
-DOPEN_PATH=demo.ppi
"-DEXPECTED_OUTPUT=document path must include a directory and file name"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/expect_pano_cli_classify_open_failure.cmake")
set_tests_properties(pano_cli_classify_open_rejects_missing_directory PROPERTIES
LABELS "app;integration;desktop-fast;fuzz"
)
add_test(NAME pano_cli_save_project_roundtrip_smoke
COMMAND "${CMAKE_COMMAND}"
-DPANO_CLI=$<TARGET_FILE:pano_cli>

View 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()