From 7015739a5b151b1b686ea30d9c09e1e600d3fb25 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sun, 28 Dec 2014 23:19:50 +0800 Subject: nettle: add test Closes #35314. Signed-off-by: Mike McQuaid --- Library/Formula/nettle.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Library') diff --git a/Library/Formula/nettle.rb b/Library/Formula/nettle.rb index 268993b3b..7df222885 100644 --- a/Library/Formula/nettle.rb +++ b/Library/Formula/nettle.rb @@ -22,4 +22,32 @@ class Nettle < Formula system "make", "install" system "make", "check" end + + test do + (testpath/"test.c").write <<-EOS.undent + #include + #include + + int main() + { + struct sha1_ctx ctx; + uint8_t digest[SHA1_DIGEST_SIZE]; + unsigned i; + + sha1_init(&ctx); + sha1_update(&ctx, 4, "test"); + sha1_digest(&ctx, SHA1_DIGEST_SIZE, digest); + + printf("SHA1(test)="); + + for (i = 0; i