]> rtime.felk.cvut.cz Git - omk/sssa.git/blob - tests/README.tests
Test framework finished
[omk/sssa.git] / tests / README.tests
1 Description of Testcases for OMK
2 ================================
3
4 Each test resides in a separate directory. The directories can be
5 nested. There is no difference between the tests in different levels of
6 directory structure.
7
8 Structure of a Testcase
9 -----------------------
10
11 A directory contains the testcase if it contains at least one of these
12 files: Makefile.test, runtest.
13
14 * Testcase Definition:
15
16   - runtest (mandatory): is the executable that runs the test(s).
17
18   - rules: Specifies the rules this testcase applies to. The syntax of
19     this files is describes in section Rules description.
20
21 * Testcase Execution:
22
23   Runtest is executed with OMK_RULES environment variable set to the
24   name of the actual rules tested.
25
26 * Testcase Output:
27
28   Each execution of testcase should produce the following outputs:
29
30   - Exit status of make or runtest: 
31         0 - the testcase was successfully passed
32         1 - testcase failed
33         2 - testcase cannot be executed (e.g. because the needed
34             compiler is not available)
35
36
37   - Error message:
38     In the case of error, the file '_error' should contain more
39     detailed description of the error.
40
41   - stdout and stderr: TODO
42
43 Rules Description
44 -----------------
45
46 If the 'rules' file is contained in the testcase, this file defines
47 a set of Makefile.rules this testcase can be applied to. If there is
48 no rules file, this testcase is applied to all the rules.
49
50 The rules file contains one line of one of the following forms:
51
52 * <rules name> - This selects only one rules file
53
54 * all: - this selects all the rules files
55
56 * snip:<snippet name> - this selects all the rules, which contain the
57   given snippet.
58
59 * python:<python exression> - The python expression is evaluated. The
60   global namespace contains the following variables:
61
62     - rules: the name of tested rules
63
64     - snippets: is of type list and contains the snippet names from
65       which the tested rules are composed.
66
67   If the expression evaluates as True, the testcase is executed with
68   this rules, otherwise it is not.
69
70   Example: python: "config_h" in snippets and rules != "rtems"