|
From: Paulo E. C. <pau...@gm...> - 2013-05-17 13:17:29
|
> > Recently we were wondering if it's possible/how to do more automated
> > testing with graphical programs. We have a way to 'dump' a scene (as
> > text, showing scenegraph) to a file. And we have a way to do a screen
> > snapshot (to an image file). One more idea: have some way to specify
> > the number of loops to advance (perhaps also time?) But nothing
> > working today as automated test suite.
> Paulo,
> There was also an idea of a record mode in freewrl: specifically:
> - number of frames
> - input: keystroke, mouse action
> - snapshot
> - dumpscene
> And perhaps put it in a special file format, for playback during testing.
> To make the number of frames smaller -so the tests run faster- the
> record mode could purposely run slow - pausing on each frame.
> -Doug
I've written a small perl test script that's using a library that I'm
currently maintaining that allows keyboard and mouse interactions when
running on a X11 env, it currently does the following:
- Opens freewrl with a given test wrl file.
- Takes a snapshot
- Goes to the next file
I have the following problems:
- Sometimes freewrl takes some time to load and gives no indication of
when it has finished rendering. We could use such hint in order to
trigger a snapshot after rendering rather than "sleeping" and hope it's
enough....
- Currently the snapshot only seems to work with PNG which has a file is
not suitable for comparison with for instance a previous master version.
- It would be interesting to know how to move to a specific viewpoint
say 45 degrees to the left,right, up, down... without having to manually
do so by means of keyboard/mouse
I'm not entirely sure that comparing image snapshots with a previous
known good image is the right way to do it but at least it exercises
some of the points you where making above.
My idea based on your comments is somehow similar to this; If we imagine
a cylinder around the main item of a given test file perhaps we could do
the following....
- Open a test file
- Wait for rendering to finish.
- Take a snapshot
- Move to a different viewpoint coordinate on the cylinder and take a
snapshot. and so on
- North, South, East, West, Above, Below
- Compare those snapshots with previously good known ones.
*This would obviously not cope well with moving objects in the scene but
that's a different ball game.
What do you guys think about this ?
I've pushed my test script to github and it lives in the branch called
testing-freewrl.
More details about it here
https://github.com/pecastro/freewrl/commits/testing-freewrl
|