Graphicalcompare

From Apache OpenOffice Wiki
Jump to: navigation, search

test graphical

The OO.o module testgraphical is a test tool to compare documents not by it's content but by it's graphical representation. With graphical compare is mentioned, compare documents by it's graphical representation.


Pre Requirements

The testgraphical module need some software to run and have to be installed locally.

  • For Windows environment a standardized printer driver is required to give a baseline reference. We don't need this in UNIX environments.
Install Adobe Universal PostScript Microsoft Windows Driver from wingsteng.exe Originally download it from:
http://www.adobe.com/support/downloads Get this crossoffice.ppd file also. It is only need within Microsoft Windows.
Select option local printer, and use FILE: as the port.
When it asks to select printer model, choose browse and go to your temp-directory and select crossoffice.ppd and then select Microsoft Office Generic printer. Select no to configuring printer when reaching the end of the install process.
Note: This is the same .ppd that is the generic OpenOffice.org driver under Unix with a little modification to fix a resolution related problem. Once installed use this printer when you print to file from Microsoft Office. This allows the same printer driver to be used under Unix and Microsoft Windows. So in theory the same output should be created by Unix version of OpenOffice.org and Microsoft Windows version of OpenOffice.org. In practice different fonts are available on different platforms and even if the ttf fonts of Microsoft Windows are made available under Unix and type1 fonts disabled then our rendering is still different (I've tried a number of approaches). Making Unix and Microsoft Windows output equivalent is certainly something to be looked into in the future. Currently there are enough problems elsewhere to be worked out before tackling that.
Optional make this printer your default Microsoft Windows printer with start->settings->printer, or remember it's name and set this name as a property like PRINTER_NAME=name into a props file.
Prefer PDF then this printer driver is not need.
  • Ghostscript is required,
get it from http://www.cs.wisc.edu/~ghost/ For Microsoft Windows only, install it to c:\gs so there are less problems. Set the environment variable path to c:\gs\gs8.71\bin. If ready, try gswin32c --help in a fresh command line shell if you get a usage message, installation of Ghostscript is done.
  • ImageMagick is required
to compare the images generated by Ghostscript from the printer output. Get it originally from: http://www.imagemagick.org/ testgraphical only the executables composite and identify out of this package are need.
  • Java 6 is required, if the differences should show as pictures.

Check requirements

There exist a tool in testgraphical

cd testgraphical/prechecks
dmake verbose=1

This will also check if all requirements are fulfilled.

Start connectable office

soffice -accept=pipe,user=$USER;urp;

start a demo

cd testgraphical/source
dmake

The connectible office should open a demonstration document, and after a short while, the test should be done.

Due to the fact we would like to test also if fails are right tested.

start a failtest

dmake failtest

The connectible office should open a document with the current time, close it and send a big log file to standard output. Due to the fact no one would like to read this log, there exist a extra helper program.

dmake failtest SHOW=1

The connectible office should open a document with the current time, close it. After a short period of time a new Java window with 3 picture views should open, which shows the currently loaded document on the left. In the middle you see a reference and on the right you see the difference too the left and the middle. This failtest is just for demonstration.

If there is not at least Java version 6 available, but only Java 5, install a Java version 6 and set the environment variable JAVA6 to the java 6 executable. This is just a hack.

Internals

Some deep information, how this tool works

document-pool

Documents should store in pools in subdirectory testgraphical/document-pool/<POOL> where <POOL> is an ASCII based name.

Limitation: sub directories under <POOL> are not supported yet.

references

References are Postscript or PDF documents of any documents stored in the document-pool created by an earlier office version.

These reference document results are stored in testgraphical/<PLATFORM>/<POOL> where <POOL> is the same name as given in document-pool. <PLATFORM> is unxlngi, wntmsci or unxsoli, for other platforms this tool is not ready yet.

The platform layer is a must, due to font differences between different OS platforms.

Limitations

  • Prefer PDF as reference. With Postscript there are Ghosts possible, small random differences in the fonts size. The reason is unknown.
  • Do not store big binary documents into this module. We get in trouble with mercurial.

Cleanups

In the near future a small subset of default documents will be in this module to check the office.

OOO_SUBSEQUENT_TESTS=1
build

Will run this tests.

Personal tools