From 9f6926265f8e4be7cc80dfe9042f2cd3c1e8dc9e Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Tue, 30 Dec 2014 22:19:32 +0800 Subject: libtiff: add test Closes #35362. Signed-off-by: Mike McQuaid --- Library/Formula/libtiff.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/libtiff.rb b/Library/Formula/libtiff.rb index 665171447..bbd9fc506 100644 --- a/Library/Formula/libtiff.rb +++ b/Library/Formula/libtiff.rb @@ -29,4 +29,21 @@ class Libtiff < Formula "--with-jpeg-lib-dir=#{jpeg}/lib" system "make", "install" end + + test do + (testpath/"test.c").write <<-EOS.undent + #include + + int main(int argc, char* argv[]) + { + TIFF *out = TIFFOpen(argv[1], "w"); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) 10); + TIFFClose(out); + return 0; + } + EOS + system ENV.cc, "test.c", "-ltiff", "-o", "test" + system "./test", "test.tif" + assert_match /ImageWidth.*10/, shell_output("#{bin}/tiffdump test.tif") + end end -- cgit v1.2.3