jbig2dec: better test

This commit is contained in:
Xu Cheng 2015-10-08 19:12:57 +08:00
parent 84400de6f0
commit 0de2322eb9

View file

@ -40,6 +40,23 @@ class Jbig2dec < Formula
end
test do
system "#{bin}/jbig2dec", "--version"
(testpath/"test.c").write <<-EOS.undent
#include <stdint.h>
#include <stdlib.h>
#include <jbig2.h>
int main()
{
Jbig2Ctx *ctx;
Jbig2Image *image;
ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
image = jbig2_image_new(ctx, 10, 10);
jbig2_image_release(ctx, image);
jbig2_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-DJBIG_NO_MEMENTO", "-L#{lib}", "-ljbig2dec", "-o", "test"
system "./test"
end
end