qxmpp: add test.

Closes #6822.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2016-11-11 14:25:45 +00:00
parent 5e17dbc384
commit bcd858d9c0

View file

@ -19,4 +19,31 @@ class Qxmpp < Formula
system "make"
system "make", "install"
end
test do
(testpath/"test.pro").write <<-EOS.undent
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
TARGET = test
QT += network
SOURCES += test.cpp
INCLUDEPATH += #{include}
LIBPATH += #{lib}
LIBS += -lqxmpp
EOS
(testpath/"test.cpp").write <<-EOS.undent
#include <qxmpp/QXmppClient.h>
int main() {
QXmppClient client;
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