aboutsummaryrefslogtreecommitdiff
path: root/modules/ECMAddTests.cmake
AgeCommit message (Collapse)Author
2022-06-12API dox: use more markup for code or commandline samplesFriedrich W. H. Kossebau
NO_CHANGELOG
2021-12-19Revert "Fix QT_PLUGIN_PATH for unittests"Ahmad Samir
As discussed in [1], it's simpler to put the files in builddir/bin/, i.e. no /plugins subdir, this makes it easier to run the unittest directly from the CLI/debugger/IDE, without relying on ctest exporting the correct QT_PLUGIN_PATH; instead QCoreApplication::libraryPaths() will pick up the plugins in e.g. builddir/bin/kf5/kio/ automatically. This will be followed by a change in KCoreAddons to remove the /plugins/ dir from the path in the builddir. [1] https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/213
2021-12-19Fix QT_PLUGIN_PATH for unittestsAhmad Samir
It was missing the "/plugins" suffix; found while building KIO with Qt6, where many unittests were failing with "couldn't create slave" for all slaves; the kio slaves are in builddir/bin/plugins/kf5/kio, and KPluginMetaData searches the directory "kf5/kio", and since it's a relative path, it assumes it's in the "plugins" dir. Keep the old behaviour for repos that put the plugins in builddir/bin/ directly without a "plugins" dir.
2021-10-02ecm_add_test: add -DQT_FORCE_ASSERTS to compile flags by defaultAlex Richardson
While debugging a failing test (KProcessTest in KCoreAddons), I noticed that the Q_ASSERT() statements inside that test weren't being executed because RelWithDebInfo builds default to passing -DQT_NO_DEBUG. With this change the test I was debugging now asserts early instead of failing a QCOMPARE later on.
2021-04-23Modules docs: move rst docs into bracket commentsFriedrich W. H. Kossebau
CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG
2020-12-07GIT_SILENT remove debugging for Windows CIDavid Faure
2020-12-07Another attempt to fix QT_PLUGIN_PATH for tests on WindowsDavid Faure
2020-12-06Windows: more double-quotes because of ';' in strings; debugging.David Faure
GIT_SILENT
2020-12-06Windows: fix QT_PLUGIN_PATH for tests by adding double-quotesDavid Faure
Otherwise the string (with ';' in it) is parsed as a list by cmake.
2020-12-06Attempt to fix kdav & purpose autotests on Windows CIDavid Faure
2020-06-14extra-cmake-modules: Convert to SPDX license statementsAndreas Cord-Landwehr
2019-03-31Re-enable the setting of QT_PLUGIN_PATH, without the strange backslash.v5.57.0-rc1v5.57.0David Faure
Let's see if purpose unittests still work on Windows (which was the reason this got commented out, kio_file wasn't found anymore). CCMAIL: bcooksley@kde.org, kfunk@kde.org
2018-08-31Disable alteration of QT_PLUGIN_PATH by ECM when running tests.Ben Cooksley
On Windows at least this is simply broken and leads to tests failing because plugins from other modules cannot be found at all. Based on this it is likely that it is broken on other platforms as well, it's just being hidden there by other logic. CCMAIL: kde-frameworks-devel@kde.org
2017-11-24ecm_add_test: Use proper path sep on WindowsKevin Funk
Summary: We need to separate paths in environment variables with a semincolon (;) on Windows. Reviewers: dfaure Subscribers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D8979
2017-11-05ECMAddTests: set QT_PLUGIN_PATH so locally built plugins can be foundDavid Faure
Summary: This of course requires running the unittests via ctest rather than launching the executable directly. Test Plan: `ctest -V -R kurifiltertest` in kio, which prints QCoreApplication::libraryPaths() at the beginning of the test. With this commit, builddir/kio/bin is added at the front of the list, and the kurifilter plugins from kio's build are loaded. Reviewers: cgiboudeaux, kfunk Reviewed By: cgiboudeaux Subscribers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D8660
2017-08-10Revert "RFC: Make ECMAddTests respect BUILD_TESTING"Kevin Funk
This broke a lot of frameworks when built WITH BUILD_TESTING=OFF. I didn't notice before since kdesrc-build was appending BUILD_TESTING=TRUE thus re-enabling the tests for me... This reverts commit b99d2d2c5dedcaba9745dddc1dd7b8d4811babf1.
2017-08-10Revert "doc: Add 'Since' note"Kevin Funk
Needed to revert parent commit This reverts commit ebbef5afcaee863c62136b14dbd06a7a73cf769a.
2017-08-09doc: Add 'Since' noteKevin Funk
2017-08-07RFC: Make ECMAddTests respect BUILD_TESTINGKevin Funk
Summary: Use-case: Make building unit tests optional, by just following the CMake BUILD_TESTING option. The usual approach to conditionally build tests is to do: ``` if (BUILD_TESTING) add_executable(TestOne TestOne.cpp) target_link_libraries(TestOne my_library) endif() ``` or: ``` if (BUILD_TESTING) add_subdirectory(tests) endif() ``` This patch just turns all calls to ecm_add_test(...) into no-ops if BUILD_TESTING=OFF. See: https://cmake.org/cmake/help/v3.6/module/CTest.html Reviewers: vkrause Reviewed By: vkrause Subscribers: kossebau, vkrause, elvisangelaccio, asturmlechner, apol, #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D7187
2016-08-31add full license textAllen Winter
REVIEW: 128780
2015-05-18Add arguments to ecm_add_tests for listing added tests.Alex Merry
This makes it convenient to make further modifications to the tests, such as setting properties on either the tests or the targets. CHANGELOG: New arguments for ecm_add_tests(). BUG: 345797 REVIEW: 123841
2015-05-18Rework ECMAddTests documentation to emphasis ecm_add_tests().Alex Merry
ecm_add_test is the less useful (and less used) version of the functions (because you really might as well just use add_executable() and add_test() manually in that case). REVIEW: 123841
2015-05-16Revert "Add PROPERTIES argument to ecm_add_test and ecm_add_tests."Alex Merry
This reverts commit 0c224194ea7f12eaed32af746fc9138537f1919c. Stephen Kelly pointed out that this is probably not the best approach to the problem, and runs counter to the direction KDE's CMake code has been going (splitting functions up and using CMake built-ins where possible). I have a better solution in mind, which I'll post a review for later. CCMAIL: kde-buildsystem@kde.org CCBUG: 345797
2015-05-13Add PROPERTIES argument to ecm_add_test and ecm_add_tests.Alex Merry
This is particularly useful with ecm_add_tests, where you may want to force a suite of tests to run in serial, or alter the timeout for multiple tests at once. BUG: 345797 REVIEW: 123722
2015-05-13Add unit tests for ECMAddTests module.Alex Merry
REVIEW: 123722
2015-02-06Document when modules were added to ECM.Alex Merry
2014-06-21ECMAddTests: make NAME_PREFIX only apply to the test, not the targetAlex Merry
David Faure and Patrick Spendrin have convinced me that NAME_PREFIX should be informational only, and not be used to prevent clashes, since it makes things confusing when you run tests manually. This is a SIC change (although in practice only kio and kconfig should be affected, currently). REVIEW: 118768 CCMAIL: kde-frameworks-devel@kde.org CCMAIL: kde-buildsystem@kde.org
2014-05-10Revert "use the NAME_PREFIX only for the test, not for the executable"Alex Merry
This reverts commits b90b64632f46e929f26ab9a4ee0033478febe0eb ba8600088b8838d5453dd0990ec595e904ec216e 554be62af6d0f01049985076b2445229bae41816 These were causing configure failures in frameworks that use ECMAddTests. CCMAIL: ps_ml@gmx.de CCMAIL: kde-frameworks-devel@kde.org
2014-05-10add in the correct location. sorry for the noisePatrick Spendrin
2014-05-10hotfixPatrick Spendrin
2014-05-09use the NAME_PREFIX only for the test, not for the executablePatrick Spendrin
2014-05-03use different syntax to run the target in question instead of an executable ↵Patrick Spendrin
in the path
2014-04-11Add documentation generation using SphinxAlex Merry
This is deliberately modelled very closely on CMake's documentation system. It's a hefty patch, because it involved changing all the documentation to be in reStructuredText format. I also cleaned up the copyright/license statements at the same time. Note that the find modules contain the full license, due to the fact that ecm_use_find_module() copies them out of the ECM distribution.
2014-01-22Mark target created by ecm_add_test as non GUI by defaultAlex Richardson
This behaviour can be overriden by passing the GUI flag to the command REVIEW: 115211
2013-10-07debug--Aleix Pol
2013-10-07Fix typoAleix Pol
ecm_add_test was renamed eventually, but all uses weren't adapted
2013-10-03Add new functions for adding unit testsAlex Richardson
Every framework in KF5 has a macro similar to these, this reduces the unnecessary duplication inside all of the frameworks REVIEW: 112828