DocbookTool icon indicating copy to clipboard operation
DocbookTool copied to clipboard

Add PDF comparisons to improve testing

Open asgrim opened this issue 4 years ago • 3 comments

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

asgrim avatar Jan 28 '21 13:01 asgrim

I wonder if content-length is stable

ciaranmcnulty avatar Oct 08 '21 13:10 ciaranmcnulty

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.

Ocramius avatar Oct 08 '21 13:10 Ocramius

The name/version of the software is baked into the image! I guess dates are in there

ciaranmcnulty avatar Oct 08 '21 13:10 ciaranmcnulty