DocbookTool
DocbookTool copied to clipboard
Add PDF comparisons to improve testing
At the moment we just assert the PDF is generated. We should also do a visual comparison to check the output matches. Note, just doing a binary diff is not sufficient, since the content DOES change every time (even if it is only /CreationDate
etc.)
Might be worth taking a look at rst2pdf technique https://github.com/rst2pdf/rst2pdf/blob/master/rst2pdf/tests/compare_pdf.sh for PDF comparison
I wonder if content-length is stable
unlikely: could have something as trivial as the name/version of the software generating the PDF baked into it, and it would break.
Visual diffing is something we've done in the past, and it's fairly OK.
The name/version of the software is baked into the image! I guess dates are in there