aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorXu Cheng2014-12-29 08:54:45 +0800
committerJack Nagel2014-12-28 21:56:06 -0500
commitb4eb53e5aa22e50be439f8fa62f5f85326f2fb10 (patch)
treeedde39d620167870eb9d6945dac44d47cac0ca83 /Library/Formula
parent904f2b7fe147f056920211868a69ec809e05843e (diff)
downloadhomebrew-b4eb53e5aa22e50be439f8fa62f5f85326f2fb10.tar.bz2
jansson: add test
Closes #35324. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/jansson.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/Formula/jansson.rb b/Library/Formula/jansson.rb
index 1db3bee06..2e27dd0c6 100644
--- a/Library/Formula/jansson.rb
+++ b/Library/Formula/jansson.rb
@@ -18,4 +18,23 @@ class Jansson < Formula
"--prefix=#{prefix}"
system "make", "install"
end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <jansson.h>
+ #include <assert.h>
+
+ int main()
+ {
+ json_t *json;
+ json_error_t error;
+ json = json_loads("\\"foo\\"", JSON_DECODE_ANY, &error);
+ assert(json && json_is_string(json));
+ json_decref(json);
+ return 0;
+ }
+ EOS
+ system ENV.cc, "test.c", "-ljansson", "-o", "test"
+ system "./test"
+ end
end