aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAkito Tabira2015-02-27 01:47:29 +0900
committerTim D. Smith2015-02-28 21:37:57 -0800
commit91e5b1397ee343054c57ce8398b72801ea931186 (patch)
treeb61b69d11b46068a3f1405cab615e2b3913fdbfe /Library
parent030fe2a222a26e3dc664682fd39f50fb41300e3a (diff)
downloadhomebrew-91e5b1397ee343054c57ce8398b72801ea931186.tar.bz2
cmocka 1.0.0
Closes #37219. Signed-off-by: Tim D. Smith <git@tim-smith.us>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/cmocka.rb36
1 files changed, 28 insertions, 8 deletions
diff --git a/Library/Formula/cmocka.rb b/Library/Formula/cmocka.rb
index 8be24bfd1..a3a56f667 100644
--- a/Library/Formula/cmocka.rb
+++ b/Library/Formula/cmocka.rb
@@ -1,17 +1,37 @@
-require 'formula'
-
class Cmocka < Formula
- homepage 'http://cmocka.cryptomilk.org/'
- url 'https://open.cryptomilk.org/attachments/download/42/cmocka-0.4.1.tar.xz'
- sha1 'ef8b64878edc5f0e442dc6aaf3dc83ef912c51c2'
+ homepage "https://cmocka.org/"
+ url "https://cmocka.org/files/1.0/cmocka-1.0.0.tar.xz"
+ sha1 "c1b6bdab164b2d54c26edacef9b9308e4de154f9"
- depends_on 'cmake' => :build
+ depends_on "cmake" => :build
def install
- mkdir 'build' do
+ mkdir "build" do
system "cmake", "..", "-DUNIT_TESTING=On", *std_cmake_args
system "make"
- system "make install"
+ system "make", "install"
end
end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <stdarg.h>
+ #include <stddef.h>
+ #include <setjmp.h>
+ #include <cmocka.h>
+
+ static void null_test_success(void **state) {
+ (void) state; /* unused */
+ }
+
+ int main(void) {
+ const struct CMUnitTest tests[] = {
+ cmocka_unit_test(null_test_success),
+ };
+ return cmocka_run_group_tests(tests, NULL, NULL);
+ }
+ EOS
+ system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lcmocka", "-o", "test"
+ system "./test"
+ end
end