summaryrefslogtreecommitdiff
path: root/pages/contrib/devs/enlightenment-regression.md.txt
blob: 753cace83abe108fa78af6d4b838388db3770696 (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Regression Testing of Enlightenment #

Enlightenment has a regression testing suite that can be of benefit when exploring a
possible defect or unexpected change in the window manager or it's applications.

The test suite can be found at https://git.enlightenment.org/devs/zmike/test-e.git
but it must be installed using the following instructions before it can be used.

## Prerequisites ##

* An up to date installation of EFL [from git](https://git.enlightenment.org/core/efl.git) or from your [operating system repository](https://phab.enlightenment.org/w/packaging_status/).
* The latest enlightenment from our [git repository](https://git.enlightenment.org/core/enlightenment.git).

## Installing ##

The test suite should be cloned from git and installed in the usual autotools manner:

    $ git clone https://git.enlightenment.org/devs/zmike/test-e.git
    $ cd test-e
    $ ./autogen.sh --prefix=<your enlightenment prefix here>
    $ make
    $ make install

## Running Tests ##

Tests are invoked using the run script:

  * ``./run.sh`` runs all available tests
  * ``./run.sh &lt;test1&gt; &lt;test2&gt;`` run the specified tests

Graphical output is rendered to a png file matching the name of the test i.e. test1.png. 

Test stdout and stderr are saved to a log file with the same name i.e. test1.log.

## Configuration ##

The following environment variables are supported to control the behaviour of the tests:

VG_ON
:  Run test(s) under valgrind

GDB_ON
:  Automatically print a backtrace on crash

TEST_EXIT
:  Use exit() instead of logging out after tests

CLEAN
:  Run ‘git clean -dxf’ before running tests

DELAY_ON
:  Wait 4 extra seconds before beginning tests

STRACE_ON
:  Run tests under strace

E_COMP_ENGINE
:  ‘sw’ or ‘gl’ to set software or gl rendering

E_WL_FORCE
:  ‘buffer’, ‘drm’, ‘x11’, ‘wl’ to set the output engine

Additionally you can change the expected outcome of a test by editing the
imgs/testname.png file. If you delete the file then it will be recreated
from the output of the next test run.

## Adding New Tests ##

To add a new test to the suite follow these steps

    Create src/&lt;newtestname&gt;.c
    Copy scripts/basic.sh to scripts/&lt;newtestname&gt;.sh
    Add src/&lt;newtestname&gt;.c to src/Makefile.mk
    Add RUN_TEST(&lt;newtestname&gt;); to src/e_mod_main.c
    Add TEST_FN(&lt;newtestname&gt;); to src/e_mod_main.h

Add the following content to src/&lt;newtestname&gt;.c as a starting point:

    #include "e_mod_main.h"
    TEST_FN(&lt;testname&gt;)
    {
        // Initialize stuff here
    }

For further examples of how to write tests please check the content of existing test files.