From 7c8e51e97bc6653bd01d462b435d5761a69020d0 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Tue, 30 Dec 2014 18:12:34 +0800 Subject: libyaml: add test Closes #35353. Signed-off-by: Mike McQuaid --- Library/Formula/libyaml.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Library/Formula') 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 + + 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 -- cgit v1.2.3