On 3/29/09, Jasper van de Gronde <th.v.d.gronde@...528...> wrote:
This sounds absolutely wonderful. And if you do this, be sure to consider opportunities for testing inkscape as well. Some time back I tried testing Inkscape just based on verbs and this already allowed me to do some cool stuff (but not enough to be standardized into a framework), having more control over Inkscape's actions could allow semi-automatic testing of quite a few Inkscape features in a way similar to the current rendering tests.
That's a very interesting idea, and underscores the importance of a generalized API, you never know what people are going to use it for.
Here a quick proof of concept I wrote to try it out:
Using my old API I wrote a script that made various shapes and did some selections moved things around etc. Then I ran it twice and saved the file each time (as svg) and ran a diff.
No difference but the filename, just as I had hoped.
Worried that lots of floating point math would be it's downfall, I used the same technique with scripts that generate these images:
http://www.cs.grinnell.edu/~bergsore/dimond-fractal.jpg http://www.cs.grinnell.edu/~bergsore/morph.jpg
(They are jpegs here but you can imagine how messy the paths are.) It worked perfectly.
Obviously this won't catch errors in the way Inkscape displays things, like bitmap comparisons, but if automated it would be very quick.
A fast and easy alternative regression test could definitely be one of my deliverables.
What do you guys think? Soren Berg