homebrew-core/Formula/cdecl.rb
Mike Naberezny b70f91ff4d cdecl: add test
Closes Homebrew/homebrew#26416.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-02-05 11:41:36 +00:00

30 lines
766 B
Ruby

require 'formula'
class Cdecl < Formula
homepage 'http://cdecl.org/'
url 'http://cdecl.org/files/cdecl-blocks-2.5.tar.gz'
sha1 '3fb349970859dfd32a7fb502cecbd3c6d8656af1'
def install
# Fix namespace clash with Lion's getline
inreplace "cdecl.c", "getline", "cdecl_getline"
bin.mkpath
man1.mkpath
ENV.append 'CFLAGS', '-DBSD -DUSE_READLINE -std=gnu89'
system "make", "CC=#{ENV.cc}",
"CFLAGS=#{ENV.cflags}",
"LIBS=-lreadline",
"BINDIR=#{bin}",
"MANDIR=#{man1}",
"install"
end
test do
output = `#{bin}/cdecl explain int *a`.strip
assert_equal "declare a as pointer to int", output
assert_equal 0, $?.exitstatus
end
end