aboutsummaryrefslogtreecommitdiff
path: root/autotests
AgeCommit message (Collapse)Author
2017-12-06Deprecate KDesktopFile::sortOrder()Alexander Volkov
Summary: The SortOrder key is deprecated by the Desktop Entry Specification: https://standards.freedesktop.org/desktop-entry-spec/latest/apc.html Reviewers: dfaure, #frameworks Reviewed By: dfaure Subscribers: #frameworks Tags: #frameworks Differential Revision: https://phabricator.kde.org/D9224
2017-12-06Fix the result of KDesktopFile::sortOrder()Alexander Volkov
Summary: KDesktopFile::sortOrder() returns the value of SortOrder key as a string whithout parsing it as a list. But according to Desktop Entry Specification https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html it's type is "string(s)", i.e. the same type as the type of Actions and MimeType keys, and thus it should be read the same way. Reviewers: #frameworks, dfaure Reviewed By: dfaure Subscribers: dfaure, #frameworks Tags: #frameworks Differential Revision: https://phabricator.kde.org/D8689
2017-12-02KConfig: fix autotest on CI with trailing slash in HOME.David Faure
Summary: The CI has $HOME=/home/jenkins/ with a trailing slash, which leads to FAIL! : KConfigTest::testPath() Compared values are not the same Actual (sc3.readPathEntry("homepath", QString())): "/home/jenkins//foo" Expected (HOMEPATH): "/home/jenkins/foo" QDir::homePath() is too clean for our purposes, use $HOME on Unix. Test Plan: kconfigtest now passes with HOME=/home/dfaure/
2017-12-02Repair broken test after commit ee2b394599.David Faure
QStringLiteral is latin1, not utf8.
2017-11-30Fix some clazy warningMontel Laurent
2017-10-26Don't build the kconfig_compiler tests when crosscompilingAleix Pol
Summary: We will be using an external version of it in practice Reviewers: #frameworks, davidedmundson Reviewed By: davidedmundson Tags: #frameworks Differential Revision: https://phabricator.kde.org/D8457
2017-08-08kconfigini: Strip leading whitespace when reading entry values.Michael Pyne
As per the Desktop Entry spec, we strip trailing whitespace from the key when we split an entry into a key/value pair at the '='. Now we also strip leading whitespace from the resulting value like we should. CCBUG:310674 Differential Revision: https://phabricator.kde.org/D7169
2017-08-04Allow to build KConfig without Qt5GuiVolker Krause
Summary: This is particularly useful for cross-compilation, where we only need the kconfig_compiler on the host system. Reviewers: #frameworks, apol, aacid Reviewed By: aacid Subscribers: aacid Tags: #frameworks Differential Revision: https://phabricator.kde.org/D6994
2017-08-01autotests: fix the failures I got here.David Faure
1) some of them can't run in parallel 2) kconfigskeletontest failed due to KSharedConfig being used under the scene (for a year now), and there's probably some QPA or widget style holding a ref (here, not in the CI). Indirectly, simply setting QStandardPaths::setTestModeEnabled(true) fixes this since KSharedConfig will then not share the instance with the non-test-mode-enabled instance.
2017-05-26tests: use QIODevice::Text in kconfigcompiler_testPino Toscano
This way, different newline endings in OSes are handled as \n when reading, and thus fixing the comparison on non-\n OSes.
2017-05-26tests: use right QProcess API in kconfigcompiler_testPino Toscano
Use the QProcess::start() variant with explicit (empty, in this case) arguments, so the program string is not parsed as shell command, thus preserving paths with spaces as such.
2017-04-25Fix relativePath calculation in KDesktopFile::locateLocal()Wolfgang Bauer
The "dir" and "path" variables were obviously swapped here by mistake. This resulted in the relativePath always being empty, and made the function return "~/.local/share/" (or "~/.config/") instead of the correct path. BUG: 345100 FIXED-IN: 5.34.0 Differential Revision: https://phabricator.kde.org/D5502
2017-02-04Fix linking on Windows: don't link kentrymaptest to KConfigCore.David Faure
It's not needed, this is purely a test for the standalone KEntryMap class.
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