diff options
| author | Xu Cheng | 2014-12-30 18:06:40 +0800 |
|---|---|---|
| committer | Mike McQuaid | 2014-12-30 10:31:53 +0000 |
| commit | 0eef4301dd65676b1de92c229f3581a0c58cf332 (patch) | |
| tree | 8566e7958787447e33146b0b67aea1023fe605c9 /Library | |
| parent | c7577f30749127fba2b21e51066e3fc774fd45cf (diff) | |
| download | homebrew-0eef4301dd65676b1de92c229f3581a0c58cf332.tar.bz2 | |
libpng: add test
Closes #35352.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/libpng.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Library/Formula/libpng.rb b/Library/Formula/libpng.rb index 776eac729..3098e05cc 100644 --- a/Library/Formula/libpng.rb +++ b/Library/Formula/libpng.rb @@ -1,5 +1,3 @@ -require "formula" - class Libpng < Formula homepage "http://www.libpng.org/pub/png/libpng.html" url "https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz" @@ -25,4 +23,20 @@ class Libpng < Formula system "make", "test" system "make", "install" end + + test do + (testpath/"test.c").write <<-EOS.undent + #include <png.h> + + int main() + { + png_structp png_ptr; + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + return 0; + } + EOS + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lpng", "-o", "test" + system "./test" + end end |
