homebrew-core/Formula/avra.rb
Mike Naberezny 4587ae5c4c avra: add test
Closes Homebrew/homebrew#26670.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2014-02-12 19:34:01 -08:00

30 lines
814 B
Ruby

require 'formula'
class Avra < Formula
homepage 'http://avra.sourceforge.net/'
url 'http://downloads.sourceforge.net/project/avra/1.3.0/avra-1.3.0.tar.bz2'
sha1 '7ad7d168b02107d4f2d72951155798c2fd87d5a9'
depends_on :autoconf
depends_on :automake
def install
# build fails if these don't exist
touch 'NEWS'
touch 'ChangeLog'
cd "src" do
system "./bootstrap"
system "./configure", "--prefix=#{prefix}"
system "make install"
end
end
test do
(testpath/"test.asm").write " .device attiny10\n ldi r16,0x42\n"
output = `#{bin}/avra -l test.lst test.asm`
assert output.include?("Assembly complete with no errors.")
assert_equal 0, $?.exitstatus
assert File.exist?("test.hex")
assert File.read("test.lst").include?("ldi r16,0x42")
end
end