Development/Chart Regression Tests
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
To prevent regressions in charts, this kind of test compares the visual representation of charts with a known good state. The test is easily extendable and does not require any knowledge about LibreOffice code.
Create a new test
To create a new test:
- Create or extend a minimal test document that focuses on one chart feature. For a new test, if it is associated to an existing bug report, name it accordingly. For example, if it is a test for bug tdf#150832, name the file "tdf1150832".
- Send it to the qa mailing list with a short statement that you license the content under MPL/LGPLv3+. Someone from the QA team will include your test in the source code.
For more technical details, read on.
Details
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 still working. The test depends on a correct import of all data.
Implementation
The tests are located in chart2/qa/extras/xshape
and the files in chart2/qa/extras/xshape/data
. The test is run in the subsequent target and needs a lot of time.
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.
Running the tests
The tests are run as part of the usual check when using
make check
, but they can also be run on their own on an existing build with:
make CppunitTest_chart2_xshape