summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt5CTestMacros.cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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>