Some thoughts on automated testing of ncurses apps
My major issue when making changes to code is that existing dependent program break. Typically the break is a UI related break, or a cursor positioning bug. UI means something may not print in the correct position, or may not print at all (thanks to
My log files contain details of positioning of copywin, and cursor. I can compare these after making changes to see if anything has changed. However, for that i must execute the same keys. Here is where
expect can help.
An expect script with some basic key movements should create the same log file after code changes. The main issues with this are the timestamps and object references which i clean out. Also, log files change when i add a debug statement or change the same. But its still a good clue to help me see what’s gone wrong if suddenly a program is printing wierdly, or I am not sure whether this is how program once behaved or displayed its screen.
These issues are however, not with older versions of rbcurse. It’s only the new version with container such as tabbedpanes, splitpanes and scrollpanes which often contain instances of each other. I am also now going to store screenshots of how test programs look when the screen loads so i know after making changes how it once looked.
expect seems to have an issue with the sleep command. It executes all the sleeps before loading the screen and then executes all the keys with no gap. However, my log file should be created okay.
(Makes mental note never to do any programming that cannot be tested automatically!)
Who are you? You have no entry in /etc/utmp! Aborting…