From 27b13ce7aedc2e78f0d67cb7691f0ffcf4cb43e6 Mon Sep 17 00:00:00 2001 From: David Christenson Date: Mon, 9 Mar 2015 02:23:13 -0600 Subject: [PATCH] libechonest: add test Compile and execute a simple test that utilizes libechonest. Closes Homebrew/homebrew#37465. Signed-off-by: Tim D. Smith --- Formula/libechonest.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Formula/libechonest.rb b/Formula/libechonest.rb index 91b55aa2fd..f91a24aee2 100644 --- a/Formula/libechonest.rb +++ b/Formula/libechonest.rb @@ -21,4 +21,21 @@ class Libechonest < Formula system "cmake", ".", *std_cmake_args system "make", "install" end + + test do + (testpath/"test.cpp").write <<-EOS.undent + #include + #include + int main() { + Echonest::Genre test; + test.setName(QLatin1String("ambient trance")); + return 0; + } + EOS + qt = Formula["qt"] + system ENV.cxx, "test.cpp", "-L#{lib}", "-lechonest", "-F#{qt.opt_lib}", + "-framework", "QtCore", "-I#{qt.opt_include}/QtCore", + "-I#{qt.opt_include}/QtNetwork", "-o", "test" + system "./test" + end end