summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt5CTestMacros.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-041-0/+3
|\ | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| * Enable cmake auto tests for -no-guiKai Pastor2016-03-301-0/+3
| | | | | | | | | | | | | | | | This change disables tests which require QtGui. Change-Id: Ib647afd086f54536054cb4c0cde5696d762ee8c4 Reviewed-by: Stephen Kelly <steveire@gmail.com> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* | CMake: Pass -std=gnu++0x to generated tests in CI.Stephen Kelly2016-01-191-0/+23
|/ | | | | | | | | | | Add -stdlib=libc++ when using AppleClang. If CMP0025 is OLD, the compiler id is 'Clang' for backward compatibility. So, if on a CI machine running 'Clang', and on APPLE, use the -stdlib=libc++ flag too. Change-Id: I4910000ce08bae1201f7fa0e0eb46622bedd5c4f Reviewed-by: Kevin Funk <kfunk@kde.org> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* CMake: Introduce qt5_add_binary_resourcesA. Klitzing2015-02-111-0/+2
| | | | | | | | | | | Optional parameter DESTINATION to set target rcc file Example: qt5_add_binary_resources(GenerateFixture "fixture.qrc") Task-number: QTBUG-41728 Change-Id: I9dc2fe8e7d5e9ad3873b89f75ab84a2a1b9d1d29 Reviewed-by: Stephen Kelly <steveire@gmail.com>
* Forward the correct compilers to the actual cmake tests.Stephen Kelly2013-08-091-0/+8
| | | | | | | | | | This was missing from commit 87db2fdef (Use the compilers used by Qt for the CMake tests., 2013-07-19) Task-number: QTQAINFRA-609 Change-Id: Ief1f0ed11d9f6268c636dc739fbf7945c5dee2c8 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Add cmake related information to the test output.Stephen Kelly2013-07-031-0/+8
| | | | | | Change-Id: Ie52630402bea331c89ac106f38ffbba4784f04ab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove the use of CMAKE_FIND_ROOT_PATH.Stephen Kelly2013-06-101-4/+0
| | | | | | | | | | | | This is actually a list in CMake, not a value to be prepended to paths. Specify the QT_SYSROOT instead to root the location of include directories. CMake will soon get a CMAKE_SYSROOT variable which will replace this. Change-Id: I239f69f127f3676a3835aa4f29638f44ef209819 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Set the sysroot if cross compiling the cmake tests.Stephen Kelly2013-04-231-0/+4
| | | | | | Change-Id: Iae268f30b86a67fcf978983ca9b12f850948dd24 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Only test cmake module versions if available for test.Stephen Kelly2013-04-111-18/+23
| | | | | | | | | | | | | | | | | The expected versions are only set if the cmake tests are set up by qmake by running qmake && make check If instead someone uses cmake directly: mkdir build && cd build && cmake .. && ctest the expected versions are not known, and the test fails without this patch. So, don't test the versions if they are not known. Change-Id: I2e8a4f651a69a8817c819d881be75ca07bc1bfd4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Use CMake facility for verbose makefiles instead of an env var.Stephen Kelly2013-04-101-0/+4
| | | | | | | | | It should also have an effect for Visual Studio project files, not just makefile generators. Change-Id: I395071f09b29a6e8967a3d44e41d30480ae783f7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Test that the CMake files create appropriate version variables.Stephen Kelly2013-04-051-1/+28
| | | | | | | Change-Id: I1d8061302fbb8494b5ae31e20a644745fe969f10 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Revert "Don't duplicate the 'top-level' include dir in all modules."Stephen Kelly2013-03-261-12/+0
| | | | | | | | | | | | | This will likely fix some odd cmake related tests in the CI. This reverts commit 316d8ececa3314ec16baf46ec4f1c5440cd951ef. Conflicts: mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in src/corelib/Qt5CoreConfigExtras.cmake.in Change-Id: Ib7714746f96bf12061d92242a42296d200c56c00 Reviewed-by: David Faure (KDE) <faure@kde.org>
* Allow specification of a namespace for modules under test.Stephen Kelly2013-03-201-1/+6
| | | | | | Change-Id: I957d662d677766732f324e48a6bc42f23f1a444c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Rename the qtinclude variable to qtclass.Stephen Kelly2013-03-201-4/+4
| | | | | | Change-Id: If454627be464e388cb8f529a6041d3ec804f22ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Run CMake dbus tests if dbus is expected to be available.Stephen Kelly2013-03-191-0/+3
| | | | | | | | Instead of first finding it and then testing that we can find it. Change-Id: I1a1090693520b1d6adadef93839f25d277947e76 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make the qtbase cmake tests work without the Widgets module.Stephen Kelly2013-03-181-0/+4
| | | | | | | | Task-number: QTBUG-28540 Change-Id: I916d104c8aba551ee9a5b34da3fd85dcb26bbf64 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Test that the ConfigVersion.cmake files work.Stephen Kelly2013-03-131-2/+2
| | | | | | | | | Invoking find_package with a version but without the version file present results in an error. Change-Id: I29d662081ad5dbd7b2259abeec06affda97cbb6a Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Don't duplicate the 'top-level' include dir in all modules.Stephen Kelly2013-02-091-0/+12
| | | | | | | | | | | | This is the <prefix>/include directory which is independent of the module and which only has to be used once. As everything uses QtCore, it is enough to set it only there. The CI system is a special case, in that it tests things before installation. Handle that case too. Change-Id: Idcdf9617e199b7d490cb3553cce07f1f464b3bec Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add missing WARNING header.Stephen Kelly2012-12-131-1/+4
| | | | | | Change-Id: I6565bda336c152dfdc0cb49f168d90bdceacb2b1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add warning about non-API in Qt5CTestMacros.Stephen Kelly2012-11-101-0/+7
| | | | | | | | | The macros are only for tests in Qt itself, and will be changed without restriction. Change-Id: I4cf5b8559be510f01d0122c59492c5ea3e71c8d3 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Generate instances of types in the CMake tests.Stephen Kelly2012-10-311-1/+6
| | | | | | | | | | | | | | | | 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/+75
| | | | | | | | | | | | | | | | | 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>
* Specify the --build-config when invoking ctest.Stephen Kelly2012-09-241-0/+2
| | | | | | | | | | | | | | | | Otherwise we get strange build errors by attempting to build an project in debug mode against a release-mode Qt: http://testresults.qt-project.org/ci/QtBase_master_Integration/build_03955/win32-msvc2010_Windows_7/log.txt.gz (grep for MSVCRTD) The CMAKE_BUILD_TYPE variable is always specified by the ctest_testcase driver as either Debug or Release. Change-Id: Ia5af7f0c31550b92679a3190e07b4e5c4ea638c6 Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Pass the unmodified directory/project name to build-project.Stephen Kelly2012-09-241-2/+2
| | | | | | | | | | | The result of replacements for special characters should not be used here. CTest needs the replacements for the test names, but requires the argument to the project() command to match the argument to ctest --build-project. Task-number: QTBUG-27087 Change-Id: I4ff7a7e00ddb65ab0c0f2305901e1d03f46e07d1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't append _build to the directory name of tests expected to fail.Stephen Kelly2012-09-241-1/+1
| | | | | | | | | | | | | The name passed to the project() command must be the same as the argument to ctest --build-project. Initially I had appended _build to disambiguate the generated project from the project under test, but that is not needed anyway as the project under test is self-contained, so it's ok. Task-number: QTBUG-27087 Change-Id: I648d57271529d4e8d308ff60b81419ade29b2e44 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Specify the project name when adding a test.Stephen Kelly2012-09-101-0/+2
| | | | | | | | | | | | | On Windows, with the devenv makecommand, this seems to be necessary. With msbuild it is not needed, nor with nmake, but it is no harm anyway. This is also what CMake does in its unit tests. Change-Id: I45f867e699c28a43ee607b47db108021fc7fef8b Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Marcus D. Hanwell <marcus.hanwell@kitware.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't set empty CMAKE_TOOLCHAIN_FILE or CMAKE_BUILD_TYPEStephen Kelly2012-08-311-2/+12
| | | | | | | | | | | | | | | The CMake Visual Studio 10 generator generates an include() for the empty CMAKE_TOOLCHAIN_FILE, causing the errors in the bug. There may be other remaining errors to cause the Windows CMake build to fail with that generator, but this patch is an improvement anyway - there is no point in setting empty strings as values for those variables. Task-number: QTBUG-27087 Change-Id: I68cce9e3dce07835db5f42777ac02d440f90f967 Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Forward the CMAKE_TOOLCHAIN_FILE to tests.Stephen Kelly2012-08-281-2/+2
| | | | | | | | A Toolchain file must be supplied to cmake to cross compile. Forward that to tests so that they can be built too. Change-Id: Ie15190ff1d1f554ce436b7cb4d37a177a7e17e56 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix unit tests when CMAKE_PREFIX_PATH env var is not set.Stephen Kelly2012-07-111-0/+3
| | | | | | | | | | | | 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>
* Forward the CMAKE_PREFIX_PATH to invoked tests.Stephen Kelly2012-07-031-2/+2
| | | | | Change-Id: I5166fb39dcf3ab660c971c4c68b714f534de40cb Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Move the macros for invoking ctest to a shared location.Stephen Kelly2012-07-031-0/+44
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>