Skip to content

Commit

Permalink
sha2: use --without-test
Browse files Browse the repository at this point in the history
  • Loading branch information
bfontaine committed Dec 8, 2015
1 parent 52c6b57 commit 7b67f29
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Formula/sha2.rb
Expand Up @@ -12,18 +12,19 @@ class Sha2 < Formula
sha256 "dc28fabf8cd4680b5ff534de7ef19ad95c4b839f6b891f80292e6ac9bd0952ad" => :mountain_lion
end

option "without-check", "Skip compile-time tests"
option "without-test", "Skip compile-time tests"

deprecated_option "without-check" => "without-test"

def install
system ENV.cc, "-o", "sha2", "sha2prog.c", "sha2.c"
system "perl", "sha2test.pl" if build.with? "check"
system "perl", "sha2test.pl" if build.with? "test"
bin.install "sha2"
end

test do
(testpath/"checkme.txt").write("homebrew")
output = pipe_output("#{bin}/sha2 -q -256 #{testpath}/checkme.txt")
expected = "12c87370d1b5472793e67682596b60efe2c6038d63d04134a1a88544509737b4"
assert output.include? expected
(testpath/"checkme.txt").write "homebrew"
assert_match "12c87370d1b5472793e67682596b60efe2c6038d63d04134a1a88544509737b4",
pipe_output("#{bin}/sha2 -q -256 #{testpath}/checkme.txt")
end
end

0 comments on commit 7b67f29

Please sign in to comment.