gengetopt: add test

Closes Homebrew/homebrew#38157.

Signed-off-by: Brett Koonce <koonce@gmail.com>
master
Baptiste Fontaine 2015-03-28 22:23:36 +01:00 committed by Brett Koonce
parent c5d396988d
commit eb60bb9c36
1 changed files with 20 additions and 7 deletions

View File

@ -1,10 +1,8 @@
require 'formula'
class Gengetopt < Formula
homepage 'http://www.gnu.org/software/gengetopt/'
url 'http://ftpmirror.gnu.org/gengetopt/gengetopt-2.22.6.tar.gz'
mirror 'http://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz'
sha1 'c93bdec17f247aa32b3cd6530a6f68aa430d67f5'
homepage "https://www.gnu.org/software/gengetopt/"
url "http://ftpmirror.gnu.org/gengetopt/gengetopt-2.22.6.tar.gz"
mirror "https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz"
sha256 "30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7"
def install
system "./configure", "--disable-dependency-tracking",
@ -12,6 +10,21 @@ class Gengetopt < Formula
"--mandir=#{man}"
ENV.deparallelize
system "make install"
system "make", "install"
end
test do
ggo = <<-EOS.undent
package "homebrew"
version "0.9.5"
purpose "The missing package manager for OS X"
option "verbose" v "be verbose"
EOS
pipe_output("#{bin}/gengetopt --file-name=test", ggo, 0)
assert File.exist? "test.h"
assert File.exist? "test.c"
assert_match(/verbose_given/, File.read("test.h"))
end
end