atk test cleanup

Closes Homebrew/homebrew#39637.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Tom Schoonjans 2015-05-12 14:35:38 +08:00 committed by Xu Cheng
parent 234e919c2b
commit 3722f77ef4

View file

@ -23,6 +23,7 @@ class Atk < Formula
system "make"
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <atk/atk.h>
@ -32,7 +33,23 @@ class Atk < Formula
return 0;
}
EOS
system ENV.cc, "-I#{HOMEBREW_PREFIX}/include/atk-1.0", "-I#{HOMEBREW_PREFIX}/include/glib-2.0", "-I#{HOMEBREW_PREFIX}/lib/glib-2.0/include", "-I#{HOMEBREW_PREFIX}/opt/gettext/include", "test.c", "-L#{HOMEBREW_PREFIX}/lib", "-L#{HOMEBREW_PREFIX}/lib", "-L#{HOMEBREW_PREFIX}/opt/gettext/lib", "-latk-1.0", "-lgobject-2.0", "-lglib-2.0", "-lintl", "-o", "test"
gettext = Formula["gettext"]
glib = Formula["glib"]
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
flags += %W[
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/atk-1.0
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{lib}
-latk-1.0
-lglib-2.0
-lgobject-2.0
-lintl
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end