aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorXu Cheng2015-01-02 21:05:39 +0800
committerMike McQuaid2015-01-02 14:27:50 +0000
commiteaa8ba1ea5f8a0832fa2ff6cfafb6d8d6f97ce91 (patch)
treebe23cb8b2b3678217a8011bf4413fa10e0dd2a8f /Library/Formula
parent450b62ff85c8b246a6ae4e8235a9942216ce912b (diff)
downloadhomebrew-eaa8ba1ea5f8a0832fa2ff6cfafb6d8d6f97ce91.tar.bz2
yasm: add test
Closes #35464. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/yasm.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/Library/Formula/yasm.rb b/Library/Formula/yasm.rb
index d6fccaf52..0ce246048 100644
--- a/Library/Formula/yasm.rb
+++ b/Library/Formula/yasm.rb
@@ -49,4 +49,26 @@ class Yasm < Formula
system "./configure", *args
system "make", "install"
end
+
+ test do
+ (testpath/"test.asm").write <<-EOS.undent
+ global start
+ section .text
+ start:
+ mov rax, 0x2000004 ; write
+ mov rdi, 1 ; stdout
+ mov rsi, qword msg
+ mov rdx, msg.len
+ syscall
+ mov rax, 0x2000001 ; exit
+ mov rdi, 0
+ syscall
+ section .data
+ msg: db "Hello, world!", 10
+ .len: equ $ - msg
+ EOS
+ system "#{bin}/yasm", "-f", "macho64", "test.asm"
+ system "/usr/bin/ld", "-macosx_version_min", "10.7.0", "-lSystem", "-o", "test", "test.o"
+ system "./test"
+ end
end