homebrew-core/Formula/afl-fuzz.rb

40 lines
1.1 KiB
Ruby
Raw Normal View History

require "formula"
class AflFuzz < Formula
desc "American fuzzy lop: Security-oriented fuzzer"
homepage "http://lcamtuf.coredump.cx/afl/"
url "http://lcamtuf.coredump.cx/afl/releases/afl-1.83b.tgz"
sha256 "5b1083537b549c74250acb43023d4bf0551508afcb07daa90330d40adb4e6efe"
head "http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz"
2014-12-06 22:36:01 +00:00
bottle do
2015-06-15 15:05:53 +00:00
sha256 "0c1f666cb9b1e564d1f08cd3f0186d410e16e1cf408d23c2ddd374f8cbcfef5f" => :yosemite
sha256 "7b3b32a1623059d186e3fa78b72de772501107c53eab62c87d8f5484d9d0a831" => :mavericks
sha256 "9d92d7eb9c958bf673fe5d8bd64bcc5ba4b502db9f8654773842b8cdac7b7d4b" => :mountain_lion
2014-12-06 22:36:01 +00:00
end
def install
system "make", "PREFIX=#{prefix}"
system "make", "install", "PREFIX=#{prefix}"
end
test do
cpp_file = testpath/"main.cpp"
2014-12-07 17:42:13 +00:00
exe_file = testpath/"test"
2014-12-07 17:42:13 +00:00
cpp_file.write <<-EOS.undent
#include <iostream>
int main() {
2014-12-07 17:42:13 +00:00
std::cout << "Hello, world!";
}
EOS
2014-12-07 17:42:13 +00:00
system "#{bin}/afl-clang++", "-g", cpp_file, "-o", exe_file
output = `#{exe_file}`
assert_equal 0, $?.exitstatus
assert_equal output, "Hello, world!"
end
end