diff options
Diffstat (limited to 'test/TEX')
-rw-r--r-- | test/TEX/auxiliaries.py | 16 | ||||
-rw-r--r-- | test/TEX/bibtex-latex-rerun.py | 14 |
2 files changed, 21 insertions, 9 deletions
diff --git a/test/TEX/auxiliaries.py b/test/TEX/auxiliaries.py index e34ddaa..39984b3 100644 --- a/test/TEX/auxiliaries.py +++ b/test/TEX/auxiliaries.py @@ -123,9 +123,8 @@ pdf_output_1 = test.read(['build', 'docs', 'test.pdf']) ps_output_1 = test.read(['build', 'docs', 'test.ps']) # Adding blank lines will cause SCons to re-run the builds, but the -# actual contents of the output files shouldn't be any different. -# This assumption won't work if it's ever used with a toolchain that does -# something to the output like put a commented-out timestamp in a header. +# actual contents of the output files should be the same modulo +# the CreationDate header. test.write(['docs', 'test.tex'], tex_input + "\n\n\n") test.run(stderr=None) @@ -133,7 +132,14 @@ test.run(stderr=None) pdf_output_2 = test.read(['build', 'docs', 'test.pdf']) ps_output_2 = test.read(['build', 'docs', 'test.ps']) -test.fail_test(pdf_output_1 != pdf_output_2) -test.fail_test(ps_output_1 != ps_output_2) + + +pdf_output_1 = test.normalize_pdf(pdf_output_1) +pdf_output_2 = test.normalize_pdf(pdf_output_2) + +assert pdf_output_1 == pdf_output_2, test.diff_substr(pdf_output_1, pdf_output_2, 80, 80) +assert ps_output_1 == ps_output_2, test.diff_substr(ps_output_1, ps_output_2, 80, 80) + + test.pass_test() diff --git a/test/TEX/bibtex-latex-rerun.py b/test/TEX/bibtex-latex-rerun.py index 353d9a4..a0ba5c2 100644 --- a/test/TEX/bibtex-latex-rerun.py +++ b/test/TEX/bibtex-latex-rerun.py @@ -95,10 +95,16 @@ test.run() pdf_output_3 = test.read('bibtest.pdf') -# If the PDF file is now different than the second run, then something -# else odd has happened, so fail. (Note that this test will be incorrect -# if the tool does something like insert a timestamp in the PDF file.) -test.fail_test(pdf_output_2 != pdf_output_3) + + +# If the PDF file is now different than the second run, modulo the +# creation timestamp and the ID, then something else odd has happened, +# so fail. + +pdf_output_2 = test.normalize_pdf(pdf_output_2) +pdf_output_3 = test.normalize_pdf(pdf_output_3) + +assert pdf_output_2 == pdf_output_3, test.diff_substr(pdf_output_2, pdf_output_3, 80, 80) |