From f831cb43684fb52546ffc764ee1ea9545f4dbbf2 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Tue, 13 Jan 2015 10:38:11 +0100 Subject: bam: test added Closes #35812. Signed-off-by: Mike McQuaid --- Library/Formula/bam.rb | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/bam.rb b/Library/Formula/bam.rb index c6c05aef3..ce922e236 100644 --- a/Library/Formula/bam.rb +++ b/Library/Formula/bam.rb @@ -1,14 +1,28 @@ -require 'formula' - class Bam < Formula - homepage 'http://matricks.github.io/bam/' - url 'https://github.com/downloads/matricks/bam/bam-0.4.0.tar.gz' - sha1 'c0f32ff9272d5552e02a9d68fbdd72106437ee69' + homepage "http://matricks.github.io/bam/" + url "https://github.com/downloads/matricks/bam/bam-0.4.0.tar.gz" + sha1 "c0f32ff9272d5552e02a9d68fbdd72106437ee69" - head 'https://github.com/matricks/bam.git' + head "https://github.com/matricks/bam.git" def install system "./make_unix.sh" - bin.install'bam' + bin.install "bam" + end + + test do + (testpath/"hello.c").write <<-EOS.undent + #include + int main(void) { printf("hello\\n"); return 0; } + EOS + + (testpath/"bam.lua").write <<-EOS.undent + settings = NewSettings() + objs = Compile(settings, Collect("*.c")) + exe = Link(settings, "hello", objs) + EOS + + system "bam", "-v" + assert_equal "hello\n", shell_output("./hello") end end -- cgit v1.2.3