diff options
| author | Baptiste Fontaine | 2015-02-03 11:44:05 +0100 |
|---|---|---|
| committer | Jack Nagel | 2015-02-03 20:50:36 -0500 |
| commit | b62a21e0ea77d7d42fc3585ebd6dedeca6d10cc8 (patch) | |
| tree | 857271b1f13011c436c81c7ada64d3a5a005b422 /Library/Formula/cunit.rb | |
| parent | 5eba6110dd65073df115f4cfa9694b828bfc4ea5 (diff) | |
| download | homebrew-b62a21e0ea77d7d42fc3585ebd6dedeca6d10cc8.tar.bz2 | |
cunit 2.1.3
Closes #36494.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula/cunit.rb')
| -rw-r--r-- | Library/Formula/cunit.rb | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/Library/Formula/cunit.rb b/Library/Formula/cunit.rb index 385711142..ffe9e22d7 100644 --- a/Library/Formula/cunit.rb +++ b/Library/Formula/cunit.rb @@ -1,13 +1,50 @@ -require 'formula' - class Cunit < Formula - homepage 'http://cunit.sourceforge.net/' - url 'https://downloads.sourceforge.net/project/cunit/CUnit/2.1-2/CUnit-2.1-2-src.tar.bz2' - sha1 '6c2d0627eb64c09c7140726d6bf814cf531a3ce0' + homepage "http://cunit.sourceforge.net/" + url "https://downloads.sourceforge.net/project/cunit/CUnit/2.1-3/CUnit-2.1-3.tar.bz2" + sha1 "eac0c71167aa3fab83483ae1313b78163f0f7238" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build def install - system "./configure", "--disable-debug", "--disable-dependency-tracking", - "--prefix=#{prefix}" - system "make install" + inreplace "bootstrap", "libtoolize", "glibtoolize" + system "sh", "bootstrap", prefix + system "make", "install" + end + + test do + (testpath/"test.c").write <<-EOS.undent + #include <stdio.h> + #include <string.h> + #include "CUnit/Basic.h" + + int noop(void) { return 0; } + + void test42(void) { CU_ASSERT(42 == 42); } + + int main(void) + { + CU_pSuite pSuite = NULL; + if (CUE_SUCCESS != CU_initialize_registry()) + return CU_get_error(); + pSuite = CU_add_suite("Suite_1", noop, noop); + if (NULL == pSuite) { + CU_cleanup_registry(); + return CU_get_error(); + } + if (NULL == CU_add_test(pSuite, "test of 42", test42)) { + CU_cleanup_registry(); + return CU_get_error(); + } + CU_basic_set_mode(CU_BRM_VERBOSE); + CU_basic_run_tests(); + CU_cleanup_registry(); + return CU_get_error(); + } + EOS + + system ENV.cc, "test.c", "-L#{lib}", "-lcunit", "-o", "test" + assert_match "test of 42 ...passed", shell_output("./test") end end |
