diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index 62263c5..9ba99be 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -290,7 +290,8 @@ Known local toolchain state: context. - `pano_cli record-render` exposes the recording renderer through JSON automation, including readback command/byte totals, and is covered by - `pano_cli_record_render_smoke`. + `pano_cli_record_render_smoke` plus + `pano_cli_record_render_rejects_oversized_target`. - `pano_cli simulate-document-history` exposes `pp_document::DocumentHistory` apply/undo/redo state through JSON automation and is covered by `pano_cli_simulate_document_history_smoke`. diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index e7159b4..7f53ddd 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -818,7 +818,8 @@ Results: context. - `pano_cli record-render` exercises that headless recording renderer and emits JSON command counts, target dimensions, backend name, trace/draw summary, and - readback command/byte totals for agent automation. + readback command/byte totals for agent automation, with an expected-failure + smoke for oversized render/readback targets. - `pano_cli simulate-document-history` exercises pure document history apply/undo/redo behavior and emits JSON layer/frame/history state for agent automation. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2ad1a19..6d4080d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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=$ + "-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 diff --git a/tests/cmake/expect_pano_cli_record_render_failure.cmake b/tests/cmake/expect_pano_cli_record_render_failure.cmake new file mode 100644 index 0000000..632b102 --- /dev/null +++ b/tests/cmake/expect_pano_cli_record_render_failure.cmake @@ -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() diff --git a/tools/pano_cli/main.cpp b/tools/pano_cli/main.cpp index 7e18faa..ec600e6 100644 --- a/tools/pano_cli/main.cpp +++ b/tools/pano_cli/main.cpp @@ -1639,6 +1639,15 @@ pp::foundation::Status parse_simulate_document_edits_args( return pp::foundation::Status::invalid_argument("width and height must be greater than zero"); } + const auto render_target_size = pp::renderer::texture_byte_size(pp::renderer::TextureDesc { + .extent = pp::renderer::Extent2D { .width = args.width, .height = args.height }, + .format = pp::renderer::TextureFormat::rgba8, + .render_target = true, + }); + if (!render_target_size) { + return render_target_size.status(); + } + return pp::foundation::Status::success(); }