Harden recording renderer CLI bounds

This commit is contained in:
2026-06-02 15:12:59 +02:00
parent c58b9a3718
commit d37145660a
5 changed files with 45 additions and 2 deletions

View File

@@ -367,6 +367,14 @@ if(TARGET pano_cli)
LABELS "renderer;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"backend\":\"recording\".*\"width\":32.*\"height\":16.*\"commands\":8.*\"drawCommands\":1.*\"readbackCommands\":1.*\"readbackBytes\":2048")
add_test(NAME pano_cli_record_render_rejects_oversized_target
COMMAND "${CMAKE_COMMAND}"
-DPANO_CLI=$<TARGET_FILE:pano_cli>
"-DEXPECTED_OUTPUT=texture byte size exceeds the configured limit"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/expect_pano_cli_record_render_failure.cmake")
set_tests_properties(pano_cli_record_render_rejects_oversized_target PROPERTIES
LABELS "renderer;integration;desktop-fast")
add_test(NAME pano_cli_simulate_document_edits_smoke
COMMAND pano_cli simulate-document-edits --width 128 --height 64)
set_tests_properties(pano_cli_simulate_document_edits_smoke PROPERTIES

View File

@@ -0,0 +1,24 @@
if(NOT DEFINED PANO_CLI)
message(FATAL_ERROR "PANO_CLI must be set")
endif()
if(NOT DEFINED EXPECTED_OUTPUT)
message(FATAL_ERROR "EXPECTED_OUTPUT must be set")
endif()
execute_process(
COMMAND "${PANO_CLI}" record-render --width 32768 --height 32768
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error)
if(result EQUAL 0)
message(FATAL_ERROR "Expected pano_cli record-render 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()