newt: add test

Closes #3284.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
This commit is contained in:
Tim D. Smith 2016-07-25 10:12:58 -07:00
parent 390421b0f3
commit a1c8897851

View file

@ -43,4 +43,18 @@ class Newt < Formula
system "./configure", *args
system "make", "install"
end
test do
ENV["TERM"] = "xterm"
system "python", "-c", "import snack"
(testpath/"test.c").write <<-EOS.undent
#import <newt.h>
int main() {
newtInit();
newtFinished();
}
EOS
system ENV.cc, testpath/"test.c", "-o", testpath/"newt_test", "-lnewt"
system testpath/"newt_test"
end
end