KGlobalAccel: [runtime] Introduce a KGLOBALACCEL_TEST_MODE env variable
ClosedPublic

Authored by graesslin on Dec 15 2016, 5:39 PM.

Details

Summary

The idea behind the env variable is to put kgloabalacceld into test mode
and let it operate on a in-memory KConfig instead of the normal rc file.

From auto tests in KWin we know that the
QStandardPath::setTestModeEnabled is not sufficient. If there are
multiple tests interacting with kglobalaccel they interact with each
other in ways we normally don't want.

With this env variable we could get KWin to have an in-memory kconfig
and support better testing of the global shortcuts. We can adjust the
shortcuts without having side effects on other tests.

Diff Detail

Repository
R268 KGlobalAccel
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 9044.Dec 15 2016, 5:39 PM
graesslin retitled this revision from to [runtime] Introduce a KGLOBALACCEL_TEST_MODE env variable.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Frameworks.
graesslin retitled this revision from [runtime] Introduce a KGLOBALACCEL_TEST_MODE env variable to KGlobalAccel: [runtime] Introduce a KGLOBALACCEL_TEST_MODE env variable.Dec 15 2016, 5:40 PM
aacid added a subscriber: aacid.Dec 21 2016, 9:19 PM

We can adjust the shortcuts without having side effects on other tests.

Why not just delete the test file on start of each test?

In D3689#70685, @aacid wrote:

We can adjust the shortcuts without having side effects on other tests.

Why not just delete the test file on start of each test?

I like my tests not affecting other tests. If for whatever reason there is already a kglobalshortcutsrc in the TEST_DATA_DIR I don't think running a kwin (or kglobalaccel) unit test should delete that file.

ltoscano set the repository for this revision to R268 KGlobalAccel.Dec 25 2016, 6:33 PM
aacid accepted this revision.Dec 27 2016, 9:08 PM
aacid added a reviewer: aacid.
This revision is now accepted and ready to land.Dec 27 2016, 9:08 PM
This revision was automatically updated to reflect the committed changes.