aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChilledheart2014-11-19 11:27:49 +0800
committerMike McQuaid2014-11-19 09:30:48 +0000
commit70d310814b3abb6bd6c1a2c049748e3b3498fcdf (patch)
tree7930e34b72ec012e41e0719d6074134fa2728a01
parent8dd8df66ea7fa7acb5c76099c8ac2b5e9ecb68d0 (diff)
downloadhomebrew-70d310814b3abb6bd6c1a2c049748e3b3498fcdf.tar.bz2
ninja: add support for build-time tests
Closes #34306. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
-rw-r--r--Library/Formula/ninja.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/Library/Formula/ninja.rb b/Library/Formula/ninja.rb
index 0c00b974d..8a463e17a 100644
--- a/Library/Formula/ninja.rb
+++ b/Library/Formula/ninja.rb
@@ -6,8 +6,23 @@ class Ninja < Formula
sha1 "c5a3af39f6d7ee3a30263f34091c046964d442f0"
head "https://github.com/martine/ninja.git"
+ option "without-tests", "Run build-time tests"
+
+ resource "gtest" do
+ url "https://googletest.googlecode.com/files/gtest-1.7.0.zip"
+ sha1 "f85f6d2481e2c6c4a18539e391aa4ea8ab0394af"
+ end
+
def install
system "python", "bootstrap.py"
+
+ if build.with? "tests"
+ (buildpath/"gtest").install resource("gtest")
+ system buildpath/"configure.py", "--with-gtest=gtest"
+ system buildpath/"ninja", "ninja_test"
+ system buildpath/"ninja_test", "--gtest_filter=-SubprocessTest.SetWithLots"
+ end
+
bin.install "ninja"
bash_completion.install "misc/bash-completion" => "ninja-completion.sh"
zsh_completion.install "misc/zsh-completion" => "_ninja"