aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2014-12-30 22:19:32 +0800
committerMike McQuaid2014-12-30 14:56:57 +0000
commit9f6926265f8e4be7cc80dfe9042f2cd3c1e8dc9e (patch)
tree27bd83ba4804e249520a7f97bee376ac48eb102d /Library
parentc9a0d4faf0a5113c9c737d995969ef619e33de20 (diff)
downloadhomebrew-9f6926265f8e4be7cc80dfe9042f2cd3c1e8dc9e.tar.bz2
libtiff: add test
Closes #35362. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/libtiff.rb17
1 files changed, 17 insertions, 0 deletions
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 <tiffio.h>
+
+ 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