Development/Chart Regression Tests

From The Document Foundation Wiki
Jump to: navigation, search

To prevent regressions in charts a new test concept has been added that allows to compare the visual representation of charts with a known good state. The test is easily extendable and does not require any knowledge about LibreOffice code.

Capabilities and Limitations

The test can easily check that the diagram is still displayed the same way. It can not check that the model did not change or that dynamic changes in diagrams are stil working. The test depends on a correct import of all data.

Implementation

The tests are located in sc/qa/extras/regression-test.cxx and the files in chart2/qa/unit/data. The test is run in the subsequent target and needs a lot of time. Right now the test only supports Calc files but can easily adjusted to support writer and impress files. These test would then need to be located in sw and sd.

The chart regression test imports a set of files and dumps the visual representation into a XML file. This XML file is then compared against a known XML file and if there are differences the test fails. The dumper is based on the XShape/XShapes of the XDrawPage in chart2::ChartView.

Create new test

It's quite easy to write a new unit test:

  1. Create or extend a test document that focuses on one feature
  2. Send it to the qa mailing list with a short statement that you license the content under MPL/LGPLv3+.