Skip to content

Separate tests from the app #3274

Closed

Description

@hluk

Problem

Currently, the tests are part of the main app executable and plugins. This makes the app unnecessarily large and requires linking with Qt Test library.

Solution

Move tests code to a separate executable instead of having it part of the app and plugins.

The artifacts build for tests will not be installed.

Script Functions

Move keys() and testSelected() script functions to a new plugin for tests.

Tests would need to pass custom plugin paths to the tested app. Maybe using an env variable COPYQ_PLUGINS.

This would require some support for calling functions/slots existing in the main server process. Possible solutions:

  • ScriptableProxy finds a QObject with specific name created by the new test plugin and call its slot with specific parameters
  • ScriptableProxy passes specific parameters to a method in the new plugin (ItemLoaderInterface)

Plugins

Move plugins/*/tests/* to src/tests/.

Move all overrides of ItemLoaderInterface::tests() to the tests themselves.

This would avoid loading plugins in tests and just run the tests assuming all plugins would be available.

CMake

The new executable copyq-tests and the new plugin will be built if WITH_TESTS=1 is set. These will not be installed.

Avoid linking the app itself with Qt Test library.

Activity

  1. self-assigned this
    on Oct 24, 2025
  2. added 17 commits that reference this issue on Oct 24, 2025
    783bb26
    058c54f
    4aa5a4c
    04c6aab
    203edad
    863765c
    36f80fd
    9d2b375
    c35a225
    1c73fa5
    7e90e83
    4daf5f9
    f74c5b0
    6480ce8
    27359dc
    58e0818
    097e7f6
  3. added a commit that references this issue on Oct 29, 2025
    17dfef3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions