aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2012-05-06 00:00:59 -0500
committerJack Nagel2012-05-06 00:03:21 -0500
commit03ec123ab0a6beb06a3c88cde4ea9e7306510c53 (patch)
treeafc0144d603abaff17e9d2437c3201cc9d7aec03 /Library/Formula
parent9039a1e7c5c26151c8b6a10d510c7164ba7de6b8 (diff)
downloadhomebrew-03ec123ab0a6beb06a3c88cde4ea9e7306510c53.tar.bz2
libraw: improve test
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/libraw.rb35
1 files changed, 13 insertions, 22 deletions
diff --git a/Library/Formula/libraw.rb b/Library/Formula/libraw.rb
index eaa1636d3..40d56ddd5 100644
--- a/Library/Formula/libraw.rb
+++ b/Library/Formula/libraw.rb
@@ -35,29 +35,20 @@ class Libraw < Formula
def test
mktemp do
- netraw = "http://www.rawsamples.ch/raws/nikon/d1/RAW_NIKON_D1.NEF"
- localraw = "#{HOMEBREW_CACHE}/Formula/RAW_NIKON_D1.NEF"
- if File.exists? localraw
- system "#{bin}/raw-identify -u #{localraw}"
- system "#{bin}/simple_dcraw -v -T #{localraw}"
- system "/usr/bin/qlmanage -p #{localraw}.tiff >& /dev/null &"
- else
- puts ""
- opoo <<-EOS.undent
- A good test that uses libraw.dylib to open and convert a RAW image
- to tiff was delayed until the RAW test image from the Internet is in your
- cache. To download that image and run the test, simply type
-
- brew fetch #{netraw}
- brew test libraw
-
- It's a fairly small image, 4 MB, that takes less time to download than
- read this. Please ignore the harmless message from brew fetch about
- No Available Formula. Brew fetch works correctly as does this well
- written software.
-
- EOS
+ cached_raw = HOMEBREW_CACHE/'RAW_NIKON_D1.NEF'
+
+ unless cached_raw.exist?
+ curl 'http://www.rawsamples.ch/raws/nikon/d1/RAW_NIKON_D1.NEF',
+ '-o', cached_raw
end
+
+ raise unless cached_raw.sha1 == 'd84d47caeb8275576b1c7c4550263de21855cf42'
+
+ cp cached_raw, Pathname.pwd
+
+ system "#{bin}/raw-identify", "-u", "RAW_NIKON_D1.NEF"
+ system "#{bin}/simple_dcraw", "-v", "-T", "RAW_NIKON_D1.NEF"
+ system "/usr/bin/qlmanage", "-p", "RAW_NIKON_D1.NEF.tiff"
end
end
end