From d94bdf72c863edeafd8250aa159f74c31607e7ae Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Wed, 31 Dec 2014 21:59:35 +0800 Subject: [PATCH] tinyxml: add test Closes Homebrew/homebrew#35397. Signed-off-by: Mike McQuaid --- Formula/tinyxml.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Formula/tinyxml.rb b/Formula/tinyxml.rb index fb104d3c4a..19f027332a 100644 --- a/Formula/tinyxml.rb +++ b/Formula/tinyxml.rb @@ -48,4 +48,23 @@ class Tinyxml < Formula Cflags: -I${includedir} EOS end + + test do + (testpath/"test.xml").write <<-EOS.undent + + World + EOS + (testpath/"test.cpp").write <<-EOS.undent + #include + + int main() + { + TiXmlDocument doc ("test.xml"); + doc.LoadFile(); + return 0; + } + EOS + system ENV.cxx, "test.cpp", "-ltinyxml", "-o", "test" + system "./test" + end end