aboutsummaryrefslogtreecommitdiff
path: root/autotests
AgeCommit message (Collapse)Author
2017-02-04Don't export KEntryMapStephen Kelly
It is internal.
2017-02-04Don't link against kconfigdata.cpp in the kentrymaptest unit test.Matthew Dawson
Due to eab822e206207c51d47f0f0da109caacfbee4e2f, KEntryMap is now an exported type. As such it is no longer needed to link in kconfigdata.cpp into this test.
2017-01-16Prefer nullptr over Q_NULLPTRKevin Funk
2017-01-15Add python bindingsStephen Kelly
2017-01-09autotest: add expected failure with Qt 5.8.0, with runtime check.David Faure
+ simplify using recursive-remove and testmode.
2017-01-08This should now use nullptrDavid Faure
2017-01-06Generate an instance with KSharedConfig::Ptr for singleton and argMartin Gräßlin
Summary: In case a kcfg with arg="true" was used and singleton the static instance method only accepted a QString config name. This made it impossible to combine a singleton config with an already existing and open KSharedConfig::Ptr. With this change an overloaded instance method is added which takes a KSharedConfig::Ptr as argument. The private ctor, though, only takes a KSharedConfig::Ptr and the instance method taking a QString argument uses KSharedConfig::openConfig on the config file name. The change is source-incompatible in the following situation: * kcfgfile arg="true" * Singleton = true * Inherits is specified In this situation the previous revision created an instance method with a QString argument and passed that to the parent constructor. This is not in accordance with the documentation. Any user of this behavior was relying on a bug. With this change now the call to the parent constructor carries a KSharedConfigPtr. Test Plan: kconfigcompiler tests still pass and a config with singleton and arg="true" generates the code as I need it Reviewers: #frameworks, dfaure, mdawson Differential Revision: https://phabricator.kde.org/D3690
2017-01-02Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAGAlbert Astals Cid
REVIEW: 129745
2016-12-16kconfig_compiler: Use nullptr in generated codeKevin Funk
Reviewers: #frameworks, davidedmundson Reviewed By: davidedmundson Differential Revision: https://phabricator.kde.org/D3702
2016-12-07Revert "Generate an instance with KSharedConfig::Ptr for singleton and arg"David Faure
This reverts commit cd4e6504dfbdface00037625f0cedda511e6d839. As suggested by Martin on release-team@kde.org, given that it breaks SC.
2016-12-07Revert "[autotest] Fix stupidity"David Faure
This reverts commit 71f16741a0288d8587876dcc7dbb33ba8f00546a.
2016-12-02[autotest] Fix stupidityMartin Gräßlin
Sorry.
2016-12-02Generate an instance with KSharedConfig::Ptr for singleton and argMartin Gräßlin
Summary: In case a kcfg with arg="true" was used and singleton the static instance method only accepted a QString config name. This made it impossible to combine a singleton config with an already existing and open KSharedConfig::Ptr. With this change an overloaded instance method is added which takes a KSharedConfig::Ptr as argument. The private ctor, though, only takes a KSharedConfig::Ptr and the instance method taking a QString argument uses KSharedConfig::openConfig on the config file name. This provides full API compatibility and at the same time allows to use KSharedConfig in addition to the arg name based variant. Test Plan: kconfigcompiler tests still pass and a config with singleton and arg="true" generates the code as I need it Reviewers: #frameworks Differential Revision: https://phabricator.kde.org/D3386
2016-11-12kconfig_compiler - generate code with overridesAllen Winter
REVIEW: 129382
2016-10-31Make kconfig_compiler autotests use the KCONFIG_ADD_KCFG_FILESAleix Pol
Summary: Instead of having an odd fake of it. Will help some required refactorings and already showed some issues, fixed by this patch, namely: - don't use string(regex replace) to extract a string from another string. in case it doesn't match it will offer the whole content which is never what we want. - messages(ERROR), the correct parameter is FATAL_ERROR, cmake understands "ERROR" as mere output string - turn the macro into a function, otherwise 2 calls in the same subdirectory are dangerous. CCBUG: 371562 Test Plan: tests still pass, projects that use the macro still build Reviewers: #frameworks, dfaure Reviewed By: dfaure Subscribers: dfaure Differential Revision: https://phabricator.kde.org/D3178
2016-09-27Marm test QSKIP when running as root.Evgeniy Sadovnik
The test checks that saving a read-only config file fails. But because root can write into read-only files, the test is failing when running by root. Check for uid when running the test and make it XFAIL if we are running as root. REVIEW: 128916
2016-05-19Add autotest for broken KAuthorised check in tryExec()David Edmundson
2016-04-16kconfigcompiler_test_signals.cpp - pedanticAllen Winter
2016-03-28Add support for get QStandardPaths locations.Sandro Knauß
Inside desktop files we want to reach also data, cache and config home to create files inside these directories. REVIEW: 127462 CHANGELOG: Add support for get QStandardPaths locations inside desktop files.
2015-12-29Ensure group is unescaped properly in kconf_update.Matthew Dawson
During a kconf_update run, an invalid group name may be treated as correct even though the name failed to unescape. This leads the group name to be a null character, which will fail. If the unescape failed, return that failure status instead. This should have no impact, as the previous result would have been wrong anyways. Now a more useful diagnostic will be returned instead. Update the unit tests to ensure this issue is tested in the future. Found in Coverity issue 258087. REVIEW: 126556
2015-12-23Fix some Clazy warningsImran Tatriev
2015-11-09In KConfigTest::testEntryMap, convert QByteArray with nulls using a char *Matthew Dawson
Due to https://codereview.qt-project.org/#/c/106473/, Qt 5.6 keeps null characters in QByteArray -> QString conversions, which breaks this test as one QByteArray contains nulls. Instead, convert the QByteArray to const char * first, so QString stops at the first null. The actual behaviour of KConfig is unchanged, as internally the conversion always went through a const char *, which avoids creating QStrings with null characters. REVIEW: 126001
2015-10-30Use QStringLiteral in generated codeMontel Laurent
REVIEW: 125833
2015-10-17Allow KConfig to use resources as fallback config filesChristoph Cullmann
Fallback will be :/kconfig/ REVIEW: 125598
2015-09-07[KDesktopFile] add readMimeTypesKai Uwe Broulik
CHANGELOG: KDesktopFile can now read mime types specified in the MimeType field REVIEW: 124746
2015-08-19unittest fix: compare floats/doubles rather than ↵David Faure
strings-made-from-floats/doubles. Qt 5.5 writes out "123.567001" for 123.567f. No matter, what we want is the roundtrip float-string-float to work, and it does.
2015-08-18Fix unit-tests, expected output changed, so update the tests.Sergio Martins
2015-08-05test_kconf_update: use QStandardPaths test modeDavid Faure
to avoid touching the user's real files
2015-08-05print path on failureDavid Faure
2015-07-27Don't generate deprecated codeAleix Pol
::usrWriteConfig is deprecated, use ::usrSave as recommended by the documentation. REVIEW: 124467
2015-06-22Support translation domain in 'kde' translation systemChusslove Illich (Часлав Илић)
In applications translations can be looked up in the globally set translation domain, but in libraries it is necessary to link every i18n call to the library's own translation domain. A new code generation option TranslationDomain= is added to enable this. It has effect only if TranslationSystem=kde is set. Added unit tests to check generated translation calls. CHANGELOG: New code generation option TranslationDomain=, for use with TranslationSystem=kde; normally needed in libraries. REVIEW: 123872
2015-06-15Unittest of reading config data from qt resourceSune Vuorela
REVIEW: 124098
2015-05-02Make the test[0-9] executables non gui, to fix OSXDavid Faure
2015-05-02improve error message when binary is not foundDavid Faure
2015-05-02Fix kconf_update for spaces in pathsDavid Faure
(CI says it happens on OSX) Unittest it on Linux by exporting XDG_DATA_HOME with a space in it. CCMAIL: kde-mac@kde.org
2015-05-01implement todoDavid Faure
2015-05-01fix test when TMPDIR is a symlinkDavid Faure
2015-05-01disable xdg-specific test on osxDavid Faure
2015-04-26Generate Q_PROPERTY entries out of KConfigSkeleton classesAleix Pol
It adds a configuration setting that makes it possible to generate Q_PROPERTY instances out of each variable exposed by the configuration class. Especially useful when it comes to exposing these classes to QtQuick interfaces. REVIEW: 123367 CHANGELOG: Generate QML-proof classes using the kconfigcompiler
2015-04-04KConfig: fix using KSharedConfig in global object destructor.David Faure
ksharedconfig_in_global_object.cpp is now in kdelibs4 too (where it works) and reproduces Albert's KgDifficulty testcase. CHANGELOG: fix assert when using KSharedConfig in a global object destructor. REVIEW: 122232
2015-03-17Allow to generate qloggingcategories support.Montel Laurent
Add new variable to specify it in *.kcfgc : "CategoryLoggingName" CHANGELOG: Allow to generate file with qloggingcategories support. REVIEW: 122931
2015-02-14Revert "Revert the SIC in commit 915976c1238be811f169eab1b02f7e8dad6410e0."Matthew Dawson
This reverts commit 9eee15917e01a89d937d1cba2eebbe9d65daeb72. As agreed with David Faure, we are going to leave this change in place for 5.7 and see what happens. CCMAIL: faure@kde.org CHANGELOG: Reverts previous commit, both can be left out of the changelog.
2015-02-14Revert the SIC in commit 915976c1238be811f169eab1b02f7e8dad6410e0.Matthew Dawson
On further reflection, introducing a SIC to fix the bug is not ideal. I'm working on something that will address the underlying bug, but I didn't have it in time for 5.7. The versioning behaviour is left, as I do want it to exist for the future. This only reverts the mandatory versioning of files to avoid the compatibility break. CHANGELOG: Undo 915976c123, which never saw a release, enough to avoid the SIC.
2015-01-07Fix KCoreConfigSkeleton when toggling a value with saves in betweenAlbert Astals Cid
REVIEW: 121838 Acked by Matthew Dawson
2015-01-06Don't upgrate config file with upd file from kde4.Montel Laurent
This patch is necessary because: When we use kf5 + kde4 application, kconf_update which launchs at the start when we launch kde. But it will migrate some config file, for example it will show that we need to migrate konversation so it will create a konversationrc in .config/ But when we launch konversation there is a kdelibs4migrator which wants to migrate settings and config in .config but it shows a konversationrc in .config so it will never migrate and we will lose all settings. So we can force to remove all .upd in kf5 but it will not fix problem during migration or when we have kde4 application install in same directory as kf5. So now I force for each upd file to have a "Version=5" so kconf_update (kf5) will migrate just kf5 upd file and it will fix my bugs. REVIEW: 121797 CHANGELOG: Now kconf_update doesn't process upd file from kde4. We need to add "Version=5" in top of the upd file otherwise it will be skipped.
2014-09-18Replace nullptr with Q_NULLPTR.Nicolás Alvarez
gcc 4.5 doesn't have nullptr.
2014-07-01Fix compiler warning due to undefined macroAlex Richardson
2014-07-01Fix reading of XDG style semicolon separated lists with escaped ';'Alex Richardson
Previously the warning "Invalid escape sequence "\;"." would appear and "\;" was replaced with just the backslash as is done for all unrecognized escape sequences. Keep both characters so that readXdgListEntry() works with values containing semicolons REVIEW: 119074
2014-07-01Fix unittest: must sync in main thread for other threads to see the changesDavid Faure
2014-07-01KSharedConfig: move mainConfig and wasTestEnabled to the thread storage.David Faure
This enables the mainConfig optimization in all threads, and ensures the user warning only happens in the main thread. The test-mode-enabled logic is only really useful in the main thread, but it's simpler to just do it in all threads. REVIEW: 118985