Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



hi all,

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
called "convwatch.py".

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:

URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc
PYTHONPATH=installation/opt/program /installation/opt/program/python
/core/bin/convwatch.py --soffice=path:/installation/opt/program/soffice
--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:

URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc
PYTHONPATH=installation/opt/program python /core/bin/convwatch.py
--soffice=connect:pipe,name=$USER /inputfiles

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.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.