]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/qt5/qtquick.cpp
1 // (c) Copyright Juergen Hunold 2012
2 // Use, modification and distribution is subject to the Boost Software
3 // License, Version 1.0. (See accompanying file LICENSE.txt or copy at
4 // https://www.bfgroup.xyz/b2/LICENSE.txt)
6 #define BOOST_TEST_MODULE QtQuick
9 #include <QGuiApplication>
14 #include <boost/test/unit_test.hpp>
16 BOOST_AUTO_TEST_CASE (defines
)
18 BOOST_CHECK_EQUAL(BOOST_IS_DEFINED(QT_QML_LIB
), true);
19 BOOST_CHECK_EQUAL(BOOST_IS_DEFINED(QT_QUICK_LIB
), true);
22 BOOST_AUTO_TEST_CASE (simple_test
)
24 QGuiApplication
app(boost::unit_test::framework::master_test_suite().argc
,
25 boost::unit_test::framework::master_test_suite().argv
);
28 QString
fileName(boost::unit_test::framework::master_test_suite().argv
[1]);
30 view
.connect(view
.engine(), SIGNAL(quit()), &app
, SLOT(quit()));
31 view
.setSource(QUrl::fromLocalFile(fileName
)); \
33 QTimer::singleShot(2000, &app
, SLOT(quit())); // Auto-close window
35 if (QGuiApplication::platformName() == QLatin1String("qnx") ||
36 QGuiApplication::platformName() == QLatin1String("eglfs")) {
37 view
.setResizeMode(QQuickView::SizeRootObjectToView
);
38 view
.showFullScreen();
42 BOOST_CHECK_EQUAL(app
.exec(), 0);