From: Al Date: 2010-01-01T06:00:05+09:00 Subject: Re: Automated testing of visual library (ncurses) Check out Expect (TCL extension; http://expect.nist.gov/) if you are only charactor based. On Dec 31, 3:34 pm, Seebs wrote: > On 2009-12-31, (rkumar) Sentinel wrote: > > > Screen's "C-a h" creates a hardcopy *sans* attributes. > > But i guess that's a start - I guess one can't have everything. > > If i can find a way to get part coverage, that would help. > > It's at least a start. > > > Unfortunately there's so much that's interactive. Clicking, typing text, > > scrolling and then typing text. > > Hmm. > > > Perhaps with a screen hardcopy, I can at least see that all test screens > > load and display the basic widgets correctly positioned with starting > > data. > > Possibly.  You could do hardcopies basically every "frame", too.  e.g., > send the first letter of a password, verify that the hardcopy now shows > the *, or whatever. > > You could probably also hack screen to write a second hardcopy file which > is a grid of attributes in some notation, so you could compare the pair > of files. > > > btw, is there something i am missing in your statement "which is > > reliable at ***obeying curses commands***". > > Essential issues: > > 1.  There is no guarantee that two correct sets of curses commands which > produce the same exact final screen output do so by sending the same > sequence of characters.  There may be many possible ways to, say, > clear all the characters on a given line.  Depending on non-obvious > externalities, or current cursor location, you might see anything from > a sequence of spaces to a special line-clear command... Curses is > specifically designed to "optimize" these things, meaning that the > sequence of characters produced is not necessarily consistent for a > given output. > 2.  Related to the above, curses can and will overwrite things.  So > imagine that curses were to send: >         foo^H^H^Hbar > You probably want to treat this precisely the same as just sending "bar". > > So basically, you want a thing which interprets the terminal escape > sequences curses generates and tells you what the final output looks > like.  Happily, screen does that (at least for vt100). > > -s > -- > Copyright 2009, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!