2014-12-04 21:00:45 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class AflFuzz < Formula
|
|
|
|
homepage "http://lcamtuf.coredump.cx/afl/"
|
2015-05-06 11:15:33 +00:00
|
|
|
url "http://lcamtuf.coredump.cx/afl/releases/afl-1.77b.tgz"
|
|
|
|
sha256 "542f5ce26e1e6c7487bd0af9d0b776cded52014a9adcc1be9ca5bd4357a0c431"
|
2014-12-04 21:00:45 +00:00
|
|
|
|
|
|
|
head "http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz"
|
|
|
|
|
2014-12-06 22:36:01 +00:00
|
|
|
bottle do
|
2015-05-07 04:44:26 +00:00
|
|
|
sha256 "6432ca2854c3931990b9d38e60bfb8b43be030c3eafbe27467174f8454ff628c" => :yosemite
|
|
|
|
sha256 "09f9ae233fada70859c751cd77944f55a097563a58cdaa26acd528fe5469a5ae" => :mavericks
|
|
|
|
sha256 "e400018988d4e2fdc1e1327b9852d688e02eed6b7265c0de58ddd0ccb47955ea" => :mountain_lion
|
2014-12-06 22:36:01 +00:00
|
|
|
end
|
|
|
|
|
2014-12-04 21:00:45 +00:00
|
|
|
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-04 21:00:45 +00:00
|
|
|
|
2014-12-07 17:42:13 +00:00
|
|
|
cpp_file.write <<-EOS.undent
|
2014-12-04 21:00:45 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main() {
|
2014-12-07 17:42:13 +00:00
|
|
|
std::cout << "Hello, world!";
|
2014-12-04 21:00:45 +00:00
|
|
|
}
|
|
|
|
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!"
|
2014-12-04 21:00:45 +00:00
|
|
|
end
|
|
|
|
end
|