bin/convwatch.py: graphical layout regression test re-incarnated
mstahl at redhat.com
Fri Mar 9 12:35:13 PST 2012
forgot to write about this, but some weeks ago i've written a small
utility that can be used for layout regression tests. like several
previous incarnations of the same idea, it bootstraps an office, loads
all documents in a directory and prints them to files. then it converts
the files to JPEGs with GhostScript and compares them against the
reference via ImageMagick tools. of course in the tradition of the 27
previous similar tools (none of which actually ran for me, btw) it is
unfortunately it is currently a bit specific to Writer, it is hardcoded
to only look at ".odt" files etc., but that should be easy to change.
you can run it like this to create reference files:
--userdir=file:///tmp/foo --reference /inputfiles
(actually perhaps it's not necessary to set the path variables when
using the python from the installation, but i haven't checked that...)
to do comparison with your changes or whatever just leave out --reference.
the comparison is very primitive, you just get a list of images that are
not identical at the end and have to investigate manually how bad that
really is in each case.
you can also connect to a running soffice instance:
PYTHONPATH=installation/opt/program python /core/bin/convwatch.py
also, it supports the --valgrind option, which given initial impressions
has the potential keep me busy for some time :-/
it is based on a handful of general purpose classes to setup connections
to an soffice process in a robust way that could be useful for writing
UNO API tests in Python.
More information about the LibreOffice