qtwebkit: add test

This commit is contained in:
Tony Theodore 2017-08-04 12:17:12 +10:00
parent 629b677602
commit f35618ef6d
2 changed files with 36 additions and 0 deletions

22
src/qtwebkit-test.cpp Normal file
View File

@ -0,0 +1,22 @@
/*
* This file is part of MXE. See LICENSE.md for licensing information.
*
* from: https://github.com/mxe/mxe/issues/1868
*/
#include <QApplication>
#include <QtWebKitWidgets/QWebView>
#include <QtWebKitWidgets/QWebFrame>
int main(int argc, char **argv){
QApplication app(argc, argv);
QWebView *view = new QWebView();
view->load(QUrl("http://google.com/"));
view->show();
app.exec();
}

View File

@ -19,4 +19,18 @@ define $(PKG)_BUILD_SHARED
cd '$(BUILD_DIR)' && '$(PREFIX)/$(TARGET)/qt5/bin/qmake' '$(SOURCE_DIR)'
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
# build test manually
# add $(BUILD_TYPE_SUFFIX) for debug builds - see qtbase.mk
$(TARGET)-g++ \
-W -Wall -std=c++11 \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
`$(TARGET)-pkg-config Qt5WebKitWidgets --cflags --libs`
# batch file to run test programs
(printf 'set PATH=..\\lib;..\\qt5\\bin;..\\qt5\\lib;%%PATH%%\r\n'; \
printf 'set QT_QPA_PLATFORM_PLUGIN_PATH=..\\qt5\\plugins\r\n'; \
printf 'test-$(PKG).exe\r\n'; \
printf 'cmd\r\n';) \
> '$(PREFIX)/$(TARGET)/bin/test-$(PKG).bat'
endef