From a3ec3adb5d5de90dfc8508fa7fc2d6696ab7f273 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Wed, 25 Mar 2015 20:48:51 +0800 Subject: ninja: add test Closes #38057. Signed-off-by: Xu Cheng --- Library/Formula/ninja.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/ninja.rb b/Library/Formula/ninja.rb index fb2744505..0b26afcc2 100644 --- a/Library/Formula/ninja.rb +++ b/Library/Formula/ninja.rb @@ -1,9 +1,7 @@ -require "formula" - class Ninja < Formula homepage "https://martine.github.io/ninja/" url "https://github.com/martine/ninja/archive/v1.5.3.tar.gz" - sha1 "b3ff794461ff5e4e1e73fe6bd11e653bbe509e63" + sha256 "7c953b5a7c26cfcd082882e3f3e2cd08fee8848ad228bb47223b18ea18777ec0" head "https://github.com/martine/ninja.git" bottle do @@ -17,7 +15,7 @@ class Ninja < Formula resource "gtest" do url "https://googletest.googlecode.com/files/gtest-1.7.0.zip" - sha1 "f85f6d2481e2c6c4a18539e391aa4ea8ab0394af" + sha256 "247ca18dd83f53deb1328be17e4b1be31514cedfc1e3424f672bf11fd7e0d60d" end def install @@ -34,4 +32,16 @@ class Ninja < Formula bash_completion.install "misc/bash-completion" => "ninja-completion.sh" zsh_completion.install "misc/zsh-completion" => "_ninja" end + + test do + (testpath/"build.ninja").write <<-EOS.undent + cflags = -Wall + + rule cc + command = gcc $cflags -c $in -o $out + + build foo.o: cc foo.c + EOS + system bin/"ninja", "-t", "targets" + end end -- cgit v1.2.3