spice-protocol: add test

This commit is contained in:
Jeffrey Wildman 2019-01-06 15:48:53 -05:00
parent 4140e231a0
commit e5229d7a06

View file

@ -3,10 +3,24 @@ class SpiceProtocol < Formula
homepage "https://www.spice-space.org/"
url "https://www.spice-space.org/download/releases/spice-protocol-0.12.14.tar.bz2"
sha256 "20350bc4309039fdf0d29ee4fd0033cde27bccf33501e13b3c1befafde9d0c9c"
revision 1
def install
system "./configure", "--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <spice/protocol.h>
int main() {
return (SPICE_LINK_ERR_OK == 0) ? 0 : 1;
}
EOS
system ENV.cc, "test.cpp",
"-I#{include}/spice-1",
"-o", "test"
system "./test"
end
end