On Wed, 2013-10-09 at 11:28 +0200, Guiu Rocafort wrote:
2013/10/9 Tavmjong Bah <tavmjong@...8...>
On Wed, 2013-10-09 at 00:51 +0200, Guiu Rocafort wrote:
Hi ! I've been looking at the GSOC and after solving a few problems I can run the tests now. Now I have to find out a way to update the tests.
I was able to run the tests without too much trouble... however I did not have a set of "good" PNGs to test against... so I gave up and went back to using the latest SVG 1.1 test suite.
To update the tests, I think you just need to put the new SVG files into the directory with the existing SVG files and then create reference PNGs in the appropriate files (known good rendering, known bad rendering). You can't just use the reference PNG files from the SVG test suite for doing automated pixel-by-pixel comparison as the results depend on the font used. (The SVG2 test suite will use a WOFF font, I think, to avoid this problem.) The existing files from the SVG test suite should be replaced by the files from the latest version of the SVG 1.1 2nd Ed test suite.
I see, I wasn't aware of that problems with the fonts. Is the problem related to the use of the SVGFreeSans font ? I saw this font in some tests so I'm guessing it's being used in all of them. I noticed this font is not in my system, so installing it in the machine is going to perform the tests should solve the problem ?
No. A search through the SVG files shows all kinds of different fonts being used. SVGFreeSans is required for some tests as is a number of other specially constructed fonts.
But since we're maybe going to use that ppa automated thing to perform the tests that probably is not an option. Would it be safe to replace all the fonts in the test by one of these safe fonts ? [1]
No. If you look carefully you'll see that each proposed font-family is actually a list of fonts. For example:
"Times New Roman", Times, serif.
If the first font "Times New Roman" isn't found, then Times is search for. If that is not found then the generic fallback font serif is used. While "Times New Roman" and Times are similar, they are not exactly the same. For the use on the web they are probably acceptable equivalents but for pixel by pixel comparison, they wont work.
The solution is to generate the PNG reference images on the same machine that the tests are going to be run on. Then the same font will be used for both the reference and the test images.
Tavmjong, i saw you're running some tests in [2], so, how are you solving these font problems ?
[1] http://www.w3schools.com/cssref/css_websafe_fonts.asp [2] http://tavmjong.free.fr/INKSCAPE/W3C_SVG_0.49/htmlInkscapeHarness/index.html
I look at each test manually and just filter out the differences in font. This is OK for a once in a while check but not for automated testing. Also, a few of the text tests really do need special fonts (found in the 'resources' directory).
I've set a personal branch in my launchpad account with the changes I made to the original code. https://code.launchpad.net/~neandertalspeople/+junk/inkscape-testsuite
After updating the test I'll try to find a way to automate the tests, and perform them regulaly. What do you think about that ? Any idea about how that could be done ? Maybe it is possible to set some kind of trigger when there is a commit in the launchpad inkscape trunk ?
This would be awesome.
Tav
Guiu