From 8c5be90e41a1888f794746a786d5330276c95b89 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Thu, 8 Oct 2015 19:21:56 +0800 Subject: [PATCH] llvm: better test --- Formula/llvm.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Formula/llvm.rb b/Formula/llvm.rb index d679ee2e66473..693867cddc7d8 100644 --- a/Formula/llvm.rb +++ b/Formula/llvm.rb @@ -175,6 +175,21 @@ def caveats end test do - system "#{bin}/llvm-config", "--version" + assert_equal prefix.to_s, shell_output("#{bin}/llvm-config --prefix").chomp + + if build.with? "clang" + (testpath/"test.cpp").write <<-EOS.undent + #include + using namespace std; + + int main() + { + cout << "Hello World!" << endl; + return 0; + } + EOS + system "#{bin}/clang++", "test.cpp", "-o", "test" + system "./test" + end end end