From 959cc51e9417f4ce30e4db2c9624d9589576f50f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 11 Nov 2016 14:31:40 +0000 Subject: [PATCH] quazip: improve test. Closes #6821. Signed-off-by: Mike McQuaid --- Formula/quazip.rb | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/Formula/quazip.rb b/Formula/quazip.rb index 88945a37ff..2dd4118618 100644 --- a/Formula/quazip.rb +++ b/Formula/quazip.rb @@ -15,21 +15,34 @@ class Quazip < Formula depends_on "qt5" def install - args = %W[ - -config release - ] - - system "qmake", "quazip.pro", *args, "PREFIX=#{prefix}", "LIBS+=-lz" + system "qmake", "quazip.pro", "-config", "release", + "PREFIX=#{prefix}", "LIBS+=-lz" system "make", "install" - - cd "qztest" do - system "qmake", *args - system "make" - (pkgshare/"test").install "qztest" - end end test do - system "#{pkgshare}/test/qztest" + (testpath/"test.pro").write <<-EOS.undent + TEMPLATE = app + CONFIG += console + CONFIG -= app_bundle + TARGET = test + SOURCES += test.cpp + INCLUDEPATH += #{include} + LIBPATH += #{lib} + LIBS += -lquazip + EOS + + (testpath/"test.cpp").write <<-EOS.undent + #include + int main() { + QuaZip zip; + return 0; + } + EOS + + system "#{Formula["qt5"].bin}/qmake", "test.pro" + system "make" + assert File.exist?("test"), "test output file does not exist!" + system "./test" end end