summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Generate instances of types in the CMake tests.Stephen Kelly2012-10-314-84/+32
| | | | | | | | | | | | | | | | All modules currently have a test_modules CMake test. The new module_includes test has very similar requirements, and can obsolete the hand-maintained test_modules tests in all modules. After all test_modules have been removed in other repos, the module_includes test can be renamed to that name. The types chosen need to have a constructor which can be invoked with no arguments. QtConcurrent has no public classes which fit that description so it is still tested separately Change-Id: Id7929cd32b3112c293cbf5e6964cc894a697f9b1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add a CMake macro to test module includesStephen Kelly2012-10-261-0/+23
| | | | | | | | | | | | | | | | | The variations of includes which should work are tested. For example, in the case of testing the QtCore module and QObject include, the following includes are generated and compiled: #include <QObject> #include <QtCore/QObject> #include <QtCore> #include <QtCore/QtCore> As the private include directories are not available to the compiler, this also tests that private headers are not included from public ones. Change-Id: Id03d0fe290c9691e0f7515015892991d1701ab72 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add missing test for the Qt5PrintSupport module.Stephen Kelly2012-10-252-0/+4
| | | | | Change-Id: Ic3860cc13fbb37a1d3ae63ad100b7d722a987272 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use the mkspec name Qt was configured with instead of default symlinkStephen Kelly2012-10-161-3/+1
| | | | | | | | | The default symlink is not available on Windows, so the qplatformdefs.h header is not available there. Instead we can bypass the symlink and use the actual mkspec name directly. Change-Id: I1d7e05f35c1ff56befab5bed307cb1755ade8377 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* CMake: Improve QT5_GET_MOC_FLAGS macroStephen Kelly2012-10-044-0/+127
| | | | | | | | | | | | We need to handle CMAKE_INCLUDE_CURRENT_DIR for include directories. Otherwise generated files located in the current binary directory are not found as expected. e.g. *.json file as meta data for Qt5's plugins generated at build time. Change-Id: I14ae1e7013f9d8b485aa990d50db4a03ca4f4b81 Reviewed-by: Yuchen Deng <loaden@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2221-501/+501
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Don't attempt to test DBus on QNX.Stephen Kelly2012-08-281-1/+1
| | | | | | | It is not expected to be there currently. Change-Id: I9e0ece35b8064ecb7cb24e55604ea78c9e6ab242 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Exclude the qplatformdefs CMake test on Windows.Stephen Kelly2012-08-181-1/+3
| | | | | | | | | | The fix for this failing test is not yet agreed to. Disable it to allow progress with the CI system while the fix is decided. Task-number: QTBUG-26869 Change-Id: Ia8089b8e66d750353e7c1c69597916af0d042856 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use POSITION_INDEPENDENT_CODE for these tests.Stephen Kelly2012-08-132-0/+4
| | | | | | | | These projects are expected to fail, but we need to make sure they fail for the right reason. Change-Id: I8a7caaa663060712c5c7113ef3b054feba2e2287 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add hints for where to find packages for projects expected to fail.Stephen Kelly2012-08-132-4/+12
| | | | | | | | In the CI system, an environment variable is used to convey the CMAKE_PREFIX_PATH, but that can not be relied upon. Change-Id: Ie4fbacaac6ae18f95a3b4d1e796a4b4c91a418c4 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add the minimum CMake version to projects built standalone.Stephen Kelly2012-08-132-0/+4
| | | | | Change-Id: If9d2a464d94faee0dccd77bc54946d91dd117db3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Require CMake 2.8.9 for the qt5_use_modules function.Stephen Kelly2012-08-101-2/+3
| | | | | | | | | | | The newer CMake version has the POSITION_INDEPENDENT_CODE property which is what we need here. The CMake 2.8.8 implementation uses awkward and incomplete string manipulation which I don't want to maintain for any amount of time when Qt 5.0 is released. Change-Id: If7ace9c6925ccdbf800f1863fa2368e55fa44d7f Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add tests of the various testlib definition possibilities.Stephen Kelly2012-07-248-0/+206
| | | | | | | | | | | The behavior of QTEST_MAIN depends on whether QT_GUI_LIB or QT_WIDGETS_LIB is defined. It could create a QGuiApplication or QApplication which could cause linking issues if the corresponding library is not linked to. The failure cases are also tested. Change-Id: I61ed0bc760564ef42ce1dbd86c83c06348c860ff Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Exclude the delayed resource file test on Windows.Stephen Kelly2012-07-231-1/+5
| | | | | | | The feature does not work there. Change-Id: I4c19577d3882b5ea01d20f4a67a512c1e6bc803e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add a test for all QtBase modules.Stephen Kelly2012-07-233-0/+123
| | | | | Change-Id: Ib87e56f063603d474e232a137246ab6a60f63a23 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix typo: delyed -> delayedStephen Kelly2012-07-204-9/+9
| | | | | Change-Id: I1e9c17a85a52f15f252392426fa0b30c101c7c30 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Add another directory to the private INCLUDE_DIRS list.Stephen Kelly2012-07-191-0/+5
| | | | | | | | | | It should be possible to include both: * <QtGui/private/qfoo.h> * <private/qfoo.h> Change-Id: I83ed5bba633b4a6b9bd38e315c987d78beecfb1b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Dereference so we can be sure the type is not forward declared.Stephen Kelly2012-07-191-1/+3
| | | | | Change-Id: I4d67a08dc645649e767153f3aa0dc57b15d50a84 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix unit tests when CMAKE_PREFIX_PATH env var is not set.Stephen Kelly2012-07-112-2/+10
| | | | | | | | | | | | Tests which are expected to not build need to get a way to find the Qt 5 config packages. Because they use try_compile, there is no way to pass the contents to it. Work around that by generating a file containing the prefix which the tests will include. Change-Id: If43080c241539e4af5fe1c183e7da72066278b73 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Move the macros for invoking ctest to a shared location.Stephen Kelly2012-07-031-42/+2
| | | | | | | | | They are still internal, but all Qt5 modules will be able to use them then. Change-Id: I42ab656115b0976ca959293dfd664ec071f35dbf Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Factorize the cmake test infrastructure to be reusable.Stephen Kelly2012-06-261-50/+1
| | | | | | | | This makes it easy to add cmake module tests for all modules. Change-Id: I303bf7674ca6ae7a8544488f96e8e02afbaa6ff0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add a variable for the private includes for modules.Stephen Kelly2012-06-233-0/+71
| | | | | | | This is required to use QPA for example in 5.0. Change-Id: I44bfc6987d778370e55c05c591f63ff84c482d0a Reviewed-by: David Faure <faure@kde.org>
* Give the CMake unit tests more meaningful names.Stephen Kelly2012-06-2339-65/+74
| | | | | Change-Id: I0a54d32ec62ff6daf7672d0aabdeb038f4c7c78f Reviewed-by: David Faure <faure@kde.org>
* Forward-port change to QT4_ADD_RESOURCES macro for missing rcc files.Stephen Kelly2012-06-234-0/+75
| | | | | | | | Forward-port of commit 9ce67d30011db4528d3d0bbee36412e13cfb80cc in cmake.git. Change-Id: I2d6c14f68f1630fc0835b3103e5058f52c2d0d13 Reviewed-by: David Faure <faure@kde.org>
* Use IF(NOT TARGET ...) before creating imported targets.Stephen Kelly2012-05-153-0/+12
| | | | | | | | | | | | | | | | | | Initially we didn't do this because someone could accidentally create another target of a conflicting name, and used a variable to store whether we have created the target already or not. That wasn't adequeate to deal with finding the package in a scope like a function, so we used a directory property. However, the directory property is not valid in the same scopes as the defined target. For example, finding a Qt module in both a directory and a subdirectory causes a conflict. As it is already unlikely that a target would be accidentally created with a name like Qt5::Core, we should simply use the IF(TARGET) form. Change-Id: If64f25d45f51edcd1edb0d4bfb5ed3bb2479bd27 Reviewed-by: David Faure <faure@kde.org>
* Find Qt5 modules automatically in the qt5_use_modules function.Stephen Kelly2012-05-141-2/+1
| | | | | | | | | | This ensures that we only find Qt5 modules from the same directory as modules we have already found, not from multiple different directories which may be incompatible. Change-Id: I7ad1d81ec41bba2e543130740041338ba44a6c3b Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make the qt5_use_modules public API.Stephen Kelly2012-05-102-39/+8
| | | | | | | | | | | | | | This cmake function handles all of the necessary logic for using the include directories of Qt modules, linking to Qt modules, adding the required definitions, and most importantly, adding the position independent flags required on UNIX systems to use Qt by default. The function relies on functionality available in CMake 2.8.8, so it is only available if that version of CMake or greater is used. Change-Id: Ibe698e06819129479348c240844264c41553b5fb Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Revert "Don't use the pri depends line for link dependencies."Stephen Kelly2012-05-033-8/+4
| | | | | | | | | | | | | This reverts commit df43b9a06a73759ba74f23d9c3e91bd0347d1026. Using the same depends information as QMake provides adds a lot of convenience for users, and is mostly 'correct' from a CMake point of view anyway. Change-Id: I8f2a2f74a687c25a0dedcc491ef72ddb5b136090 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Never attempt to run the dbus tests on APPLE.Stephen Kelly2012-05-012-3/+1
| | | | | | | | | | | | | The Qt buildsystem is creating the config files for it even when it is not building QtDBus, so Qt5DBus_FOUND = True. Re-enable the CI testing on mac with this change. Task-number: QTBUG-25522 Change-Id: I5d2690d17fde6c5aabcbdd3e2eef9f0846edd97d Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Simplify the cmake version check.Stephen Kelly2012-04-291-1/+1
| | | | | | Change-Id: Ifdd89397f88b090a6b43d40636dbeac029faaed8 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add some more useful output when about the cmake versionStephen Kelly2012-04-291-1/+1
| | | | | | Change-Id: I58efa1f295dbc652b1882937ca27ea52d9f4a923 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* cmake: temporarily set tests/auto/cmake insignificant on macRohan McGovern2012-04-271-0/+6
| | | | | | | | | cmake was installed on CI macs _after_ this test was added, causing the test to block unrelated changes. Temporarily disable it as previously agreed with Stephen Kelly. Change-Id: I079c0016a5e4a9a03ee1a0bae9a2e836c6b985d6 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Run DBus tests only if QtDBus is found.Stephen Kelly2012-04-241-1/+4
| | | | | | | | | It's not enough to check for UNIX because Qt may have been configured without dbus, or we could be running on APPLE (on which DBus is not commonly installed). Change-Id: Ic57200dad42c0c12b292d1066f799c827294fe9a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move the CMake unit tests to auto/Stephen Kelly2012-04-2334-0/+1415
This will allow the CI system to run the tests. The tests are only run if cmake is found. Change-Id: Ie73a56114c151871160bafcbf0b90b2d54620855 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>