Currently, i have no way of knowing what's broken.
1. One thought that comes is to take some kind of screen dump and
compare screen dumps when testing. (I am on a unix terminal, of course,
OS X)
2. I don't think logging to a file and comparing logs would be of much
benefit.
Thoughts and pointers welcome.
--
Posted via http://www.ruby-forum.com/.
> Thoughts and pointers welcome.
You could take a look at web app testing frameworks (like WATIR, or
Selenium), and see how they do their tests.
That assumes, though, that you have similar access to ncurses widgets as
you'd have for HTML tags.
Another option are tools emulating keyboard / mouse input, and let those
loose on the application with the use of macros / testing frameworks.
Not sure if you can test for "pixel perfectness", but since ncurses'
layout depends on the size of the TTY used, I don't know if that'd be
useful, anyway.
--
Phillip Gawlowski
> 2. I don't think logging to a file and comparing logs would be of much
> benefit.
Hmm.
Suggestion:
See if you can figure out a way to externally command screen(1) to do a
hardcopy dump, and if so, run your stuff in a screen session, then dump
the current state of the display to a file -- I think that should get
you the same characters for the same output regardless of how you got
there.
Basically, you need a terminal emulator which is reliable at obeying
curses commands. Luckily, one exists.
-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
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.
Unfortunately there's so much that's interactive. Clicking, typing text,
scrolling and then typing text.
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.
btw, is there something i am missing in your statement "which is
reliable at ***obeying curses commands***".
thanks, rk.
Is there something like Webrat that will work for console apps?
>
> btw, is there something i am missing in your statement "which is
> reliable at ***obeying curses commands***".
>
> thanks, rk.
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
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).
On Dec 31, 3:34 pm, Seebs <usenet-nos...@seebs.net> wrote:
> 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!
I've been working on a pure-ruby terminal emulator the past few
days... unfortunately it doesn't handle many things yet, in particular
scroll regions are problematic.
If you want to try it, or contribute, grab ruby 1.9, ffi-tk, and
http://github.com/manveru/yonde
I'd be happy about anyone who has some experience with terminals, my
best reference right now is the manpage for terminfo...
Anyway, using yonde, you could test any aspect of your application
using ruby, and you can also check things like use of color or other
attributes, which a hardcopy can't give you.
--
Michael Fellinger
CTO, The Rubyists, LLC
>> Thoughts and pointers welcome.
>
> I've been working on a pure-ruby terminal emulator the past few
> days... unfortunately it doesn't handle many things yet, in particular
> scroll regions are problematic.
> If you want to try it, or contribute, grab ruby 1.9, ffi-tk, and
> http://github.com/manveru/yonde
1. Does it work on 1.9
2. Does it require Ruby Tk ?
It works _only_ on Ruby 1.9, and it doesn't require Ruby Tk.