diff options
| author | Charlie Sharpsteen | 2011-08-27 13:48:38 -0700 |
|---|---|---|
| committer | Charlie Sharpsteen | 2011-08-27 13:53:22 -0700 |
| commit | d47526a4bcb801501df004bf551d72b050bd374f (patch) | |
| tree | a68c9ff95caa51f3b7f61a454525673b6a460253 /Library/Formula/asymptote.rb | |
| parent | b86d1407260a733b83dd8f927eb9d46eae089ad0 (diff) | |
| download | homebrew-d47526a4bcb801501df004bf551d72b050bd374f.tar.bz2 | |
Asymptote: Add a test
The test creates a temporary directory, writes out a simple LaTeX file
containing an Asymptote figure, then tries to compile it.
Diffstat (limited to 'Library/Formula/asymptote.rb')
| -rw-r--r-- | Library/Formula/asymptote.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Library/Formula/asymptote.rb b/Library/Formula/asymptote.rb index eacbbbe3a..d10056e0f 100644 --- a/Library/Formula/asymptote.rb +++ b/Library/Formula/asymptote.rb @@ -33,6 +33,34 @@ class Asymptote < Formula system "make install" end + def test + ENV['TEXMFHOME'] = "#{HOMEBREW_PREFIX}/share/texmf" + mktemp do + (Pathname.new(Dir.getwd) + 'asy_test.tex').write <<-EOS.undent + \\nonstopmode + + \\documentclass{minimal} + \\usepackage{asymptote} + + \\begin{document} + Hello, Asymptote! + + \\begin{asy} + size(3cm); + draw((0,0)--(1,0)--(1,1)--(0,1)--cycle); + \\end{asy} + + \\end{document} + EOS + + system "pdflatex asy_test" + system "asy asy_test-1.asy" + system "pdflatex asy_test" + end + + return (not $? == 0) + end + def caveats caveats = <<-EOS 1) This formula links the latest version of the Asymptote LaTeX and ConTeXt |
