aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libyaml.rb
diff options
context:
space:
mode:
authorXu Cheng2014-12-30 18:12:34 +0800
committerMike McQuaid2014-12-30 10:51:49 +0000
commit7c8e51e97bc6653bd01d462b435d5761a69020d0 (patch)
tree4930925f7a0a64a43d8949ea0decfe732f71defa /Library/Formula/libyaml.rb
parentc0429f60f6dd5b2bf536d79277087d599d075813 (diff)
downloadhomebrew-7c8e51e97bc6653bd01d462b435d5761a69020d0.tar.bz2
libyaml: add test
Closes #35353. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/libyaml.rb')
-rw-r--r--Library/Formula/libyaml.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/Library/Formula/libyaml.rb b/Library/Formula/libyaml.rb
index f14faf317..a89e278ce 100644
--- a/Library/Formula/libyaml.rb
+++ b/Library/Formula/libyaml.rb
@@ -1,5 +1,3 @@
-require "formula"
-
class Libyaml < Formula
homepage "http://pyyaml.org/wiki/LibYAML"
url "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz"
@@ -22,4 +20,20 @@ class Libyaml < Formula
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "make", "install"
end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <yaml.h>
+
+ int main()
+ {
+ yaml_parser_t parser;
+ yaml_parser_initialize(&parser);
+ yaml_parser_delete(&parser);
+ return 0;
+ }
+ EOS
+ system ENV.cc, "test.c", "-lyaml", "-o", "test"
+ system "./test"
+ end
end