autobrew: use homebrew's built-in test fixture

This commit is contained in:
James R. Barlow
2018-02-05 11:10:33 -08:00
parent bd30587bf1
commit 4a61beae41
+1 -21
View File
@@ -55,28 +55,8 @@ ${resources}
# Since we use Python 3, we require a UTF-8 locale
ENV["LC_ALL"] = "en_US.UTF-8"
# One page Postscript with the wording "Testing" on the page
# This is more compact than including a test PDF
(testpath/"test.ps").write(
<<~EOS
%!PS
/Times-Roman findfont
20 scalefont
setfont
gsave
newpath
200 400 moveto
(Testing) show
closepath
stroke
showpage
EOS
)
system "#{Formula["ghostscript"].opt_bin}/ps2pdf", testpath/"test.ps", testpath/"test.pdf"
# Use ocrmypdf -f to rasterize the PDF to image before doing OCR
system "#{bin}/ocrmypdf", "-f", "-q", "--deskew", testpath/"test.pdf", testpath/"ocr.pdf"
system "#{bin}/ocrmypdf", "-f", "-q", "--deskew", test_fixtures("test.pdf"), testpath/"ocr.pdf"
end
end
""")