File: fixing-bugs.rst

package info (click to toggle)
copyq 3.7.3-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 10,480 kB
  • sloc: cpp: 51,894; sh: 734; python: 211; xml: 57; makefile: 34
file content (61 lines) | stat: -rw-r--r-- 1,967 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Fixing Bugs and Adding Features
===============================

This page describes how to build, fix and improve the source code.

Making Changes
--------------

Pull requests are welcome at `github project
page <https://github.com/hluk/CopyQ>`__.

For more info see `Creating a pull request from a fork <https://help.github.com/articles/creating-a-pull-request-from-a-fork/>`__.

Try to keep the code style consistent with the existing code.

Build the Debug Version
-----------------------

.. code-block:: bash

    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_TESTS=ON ..
    make

Run Tests
---------

You can run automated tests if the application is built either in debug
mode, with CMake flag ``-DWITH_TESTS=ON`` or QMake flag
``CONFIG+=tests`` (releases are usually build with tests).

Run the tests with following command.

.. code-block:: bash

    copyq tests

This command will execute all test cases in new special CopyQ session so
that user configuration, tabs and items are not modified. It's better to
close any other CopyQ session before running tests since they can affect
test results.

While running tests there must be **no keyboard and mouse interaction**.
Preferably you can execute the tests in separate virtual environment. On
Linux you can run the tests on virtual X11 server with ``xvfb-run``.

.. code-block:: bash

    xvfb-run sh -c 'openbox & sleep 1; copyq tests'

Test invocation examples:

- Print help for tests: ``copyq tests --help``
- Run specific tests: ``copyq tests commandHelp commandVersion``
- Run specific tests for a plugin: ``copyq tests 'PLUGINS:pinned' isPinned``
- Run tests only for specific plugins: ``copyq tests 'PLUGINS:pinned|tags'``
- List tests: ``copyq tests -functions``
- List tests for a plugin: ``copyq tests PLUGINS:tags -functions``
- Less verbose tests: ``copyq tests -silent``
- Slower GUI tests: ``COPYQ_TESTS_KEYS_WAIT=1000 COPYQ_TESTS_KEY_DELAY=50 copyq tests editItems``