diff options
| author | Baptiste Fontaine | 2015-03-20 13:28:15 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2015-03-21 09:58:16 +0000 |
| commit | d2396c207f46be54813f1cd54de59559687a0913 (patch) | |
| tree | 74b7cf7009aed07bff2b9e2c300ecaa5aa8f667d /Library/Formula | |
| parent | d0f255ba0d0f7cd711f70f15081e40660b3f037a (diff) | |
| download | homebrew-d2396c207f46be54813f1cd54de59559687a0913.tar.bz2 | |
qi: test added
Closes #37909.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/qi.rb | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/Library/Formula/qi.rb b/Library/Formula/qi.rb index f641eadf8..2f9d3569b 100644 --- a/Library/Formula/qi.rb +++ b/Library/Formula/qi.rb @@ -1,35 +1,37 @@ -require 'formula' - class Qi < Formula - homepage 'http://www.lambdassociates.org/' - url 'http://www.lambdassociates.org/Download/QiII1.07.zip' - sha1 '9170e2667902ada04bae3bf494b9560bc3d58fee' + homepage "http://www.lambdassociates.org/" + url "http://www.lambdassociates.org/Download/QiII1.07.zip" + sha256 "515bb99efa1da3f8d416c370c9d98776d273c593efa241dc243da543118fc521" + + depends_on "sbcl" => :optional - option 'SBCL', 'Use SBCL instead of CLISP' + deprecated_option "SBCL" => "with-sbcl" - if build.include? 'SBCL' - depends_on 'sbcl' - else - depends_on 'clisp' + if build.without? "sbcl" + depends_on "clisp" end def install - if build.include? 'SBCL' - cd 'Lisp' do + if build.with? "sbcl" + cd "Lisp" do system "sbcl", "--load", "install.lsp" end - system "echo \"#!/bin/bash\nsbcl --core #{prefix}/Qi.core $*\" > qi" - prefix.install 'Lisp/Qi.core' + (bin/"qi").write "#!/bin/bash\nsbcl --core #{prefix}/Qi.core $*" + prefix.install "Lisp/Qi.core" else - cd 'Lisp' do + cd "Lisp" do system "clisp", "install.lsp" end - system "echo \"#!/bin/bash\nclisp -M #{prefix}/Qi.mem $*\" > qi" - prefix.install 'Lisp/Qi.mem' + (bin/"qi").write "#!/bin/bash\nclisp -M #{prefix}/Qi.mem $*" + prefix.install "Lisp/Qi.mem" end - system "chmod 755 qi" - bin.install ['qi'] + chmod 0755, bin/"qi" + end + + test do + assert_match(/\(0-\) 42/, + pipe_output("#{bin}/qi", "(+ 40 1 1)\n(quit)\n", 0)) end end |
