Skip to content

Commit

Permalink
Extract version 5.57.0 from homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
NlightNFotis committed May 13, 2022
1 parent d3fc02f commit 6aed9aa
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Formula/cbmc@5.57.0.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class CbmcAT5570 < Formula
desc "C Bounded Model Checker"
homepage "https://www.cprover.org/cbmc/"
url "https://github.com/diffblue/cbmc.git",
tag: "cbmc-5.57.0",
revision: "58d64d853a236a3f9eca46c1b60ed0cf9324fbfd"
license "BSD-4-Clause"

depends_on "cmake" => :build
depends_on "maven" => :build
depends_on "openjdk" => :build

uses_from_macos "bison" => :build
uses_from_macos "flex" => :build

on_linux do
depends_on "gcc"
end

fails_with gcc: "5"

def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"

# lib contains only `jar` files
libexec.install lib
end

test do
# Find a pointer out of bounds error
(testpath/"main.c").write <<~EOS
#include <stdlib.h>
int main() {
char *ptr = malloc(10);
char c = ptr[10];
}
EOS
assert_match "VERIFICATION FAILED",
shell_output("#{bin}/cbmc --pointer-check main.c", 10)
end
end

0 comments on commit 6aed9aa

Please sign in to comment.