Skip to content

Commit

Permalink
ninja: add test
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#38057.

Signed-off-by: Xu Cheng <xucheng@me.com>
  • Loading branch information
xu-cheng committed Mar 25, 2015
1 parent 5f9cb2f commit 836520c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Formula/ninja.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -34,4 +32,16 @@ def install
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

0 comments on commit 836520c

Please sign in to comment.