From a436830bf751c25794ebac1ade6c768464fb1ffa Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sat, 18 Apr 2015 23:22:11 +0800 Subject: [PATCH] x264: add test --- Formula/x264.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Formula/x264.rb b/Formula/x264.rb index f3eda70bff..2301063fc6 100644 --- a/Formula/x264.rb +++ b/Formula/x264.rb @@ -48,4 +48,22 @@ class X264 < Formula system "./configure", *args system "make", "install" end + + test do + (testpath/"test.c").write <<-EOS.undent + #include + #include + + int main() + { + x264_picture_t pic; + x264_picture_init(&pic); + x264_picture_alloc(&pic, 1, 1, 1); + x264_picture_clean(&pic); + return 0; + } + EOS + system ENV.cc, "-lx264", "test.c", "-o", "test" + system "./test" + end end