aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"