Fix PT-P710BT raster protocol handling and add regression coverage.

Align print command payload generation with model-specific protocol requirements, add verbose CLI diagnostics and robust status retries, and introduce protocol regression tests to prevent future GF/ESC i z regressions.

Made-with: Cursor
This commit is contained in:
knb
2026-04-17 03:24:00 +09:00
parent e92273a747
commit 42a785f086
8 changed files with 219 additions and 39 deletions

View File

@@ -25,6 +25,7 @@ configure_file(
set(LIBPTOUCH_SOURCES
src/lib/libptouch_core.c
src/lib/libptouch_usb.c
src/lib/libptouch_protocol.c
src/lib/libptouch_layout.c
src/lib/libptouch_media_info.c
src/lib/libptouch_trim.c
@@ -74,6 +75,19 @@ if(NOT MSVC)
target_compile_options(ptouch-print PRIVATE -Wall -Wextra -Wpedantic)
endif()
enable_testing()
add_executable(ptouch-protocol-regression-test
tests/protocol_regression_test.c
src/lib/libptouch_protocol.c
)
target_include_directories(ptouch-protocol-regression-test PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src/lib"
)
if(NOT MSVC)
target_compile_options(ptouch-protocol-regression-test PRIVATE -Wall -Wextra -Wpedantic)
endif()
add_test(NAME protocol_regression_test COMMAND ptouch-protocol-regression-test)
install(TARGETS ptouch ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(TARGETS ptouch_shared LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")