1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Initial work on a terminal test program.

This has all the basic necessities to become a test of the terminal's
behaviour, in terms of how its data structures evolve as output is
sent to it, and perhaps also (by filling in the stub TermWin more
usefully) testing what it draws during updates and what it sends in
response to query sequences.

For the moment, all I've done is to set up the framework, and add one
demo test of printing some ordinary text and observing that it appears
in the data structures and the cursor has moved.

I expect that writing a full test of terminal.c will be a very big
job. But perhaps I or someone else will find time to prod it gradually
in the background of other work. In particular, when I'm _modifying_
any part of the terminal code, it would be good to add some tests for
the part I'm changing, before making the change, and check they still
work afterwards.
This commit is contained in:
Simon Tatham
2023-03-04 17:47:01 +00:00
parent c890449d76
commit 57536cb7a3
5 changed files with 194 additions and 5 deletions

View File

@ -236,3 +236,11 @@ add_executable(test_lineedit
${CMAKE_SOURCE_DIR}/stubs/no-timing.c)
target_link_libraries(test_lineedit
guiterminal settings eventloop charset utils ${platform_libraries})
add_executable(test_terminal
${CMAKE_SOURCE_DIR}/test/test_terminal.c
${CMAKE_SOURCE_DIR}/stubs/no-gss.c
${CMAKE_SOURCE_DIR}/stubs/no-storage.c
${CMAKE_SOURCE_DIR}/stubs/no-timing.c)
target_link_libraries(test_terminal
guiterminal settings eventloop charset utils ${platform_libraries})

View File

@ -333,6 +333,7 @@ void gtk_setup_config_box(
#define DEFAULT_CODEPAGE 0xFFFF
#define CP_UTF8 CS_UTF8 /* from libcharset */
#define CP_437 CS_CP437 /* used for test suites */
#define CP_ISO8859_1 CS_ISO8859_1 /* used for test suites */
#define strnicmp strncasecmp
#define stricmp strcasecmp