The Accidental Rubyist

invalid byte sequence in UTF-8

Some thoughts on automated testing of ncurses apps

leave a comment »

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 copywin).

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…


Written by totalrecall

February 8, 2010 at 7:56 pm

Posted in ncurses

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: