Skip to content

Rewrite KSPaths::writableLocation to give test their own environment.

This MR rewrites KSPaths::writableLocation to be equivalent to QStandardPaths::writableLocation, and adjusts KSPaths::locate and KSPaths::locateAll to avoid hardcoding an application name when not running a test. This therefore impacts their usage throughout KStars, which this MR takes care of. This is in the context of #86 (closed).

This MR thus allows tests, which have different executable names, to store data in their own space such as ~/.qttest/share/<test name> or ~/.qttest/cache/<test name> and avoid overwriting data of other tests. This is a first step towards parallel execution.

When running a test, application-local locations embed the application name. For tests to find their files in either the test-based or kstars-based locations, KSPaths::locate and KSPaths::locateAll are adjusted to retry finding their target with kstars hardcoded. Note that QtTest enforces the usage of the .qttest subfolder of the $HOME folder, which prevents tests from finding anything in the $HOME/.local folder, even when looking for the hardcoded kstars.

Edited by Eric Dejouhanet

Merge request reports

Loading