]> rtime.felk.cvut.cz Git - omk/sssa.git/blob - tests/README.tests
Specification of test cases updated.
[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   - Makefile.test: testcase commands are in the form of makefile. The
17     test is run by "make -f Makefile.test".
18
19   - runtest: executable file that runs the test(s).
20
21   - rules: Specifies the rules this testcase applies to. The syntax of
22     this files is describes in section Rules description.
23
24 * Testcase Output:
25
26   Each execution of testcase should produce the following outputs:
27
28   - Exit status of make or runtest: 
29         0 - the testcase was successfully passed
30         1 - testcase failed
31         2 - testcase cannot be executed (e.g. because the needed
32             compiler is not available)
33
34
35   - Error message:
36     In the case of error, the file 'error' should contain more
37     detailed description of the error.
38
39   - stdout and stderr: TODO
40
41 Rules Description
42 -----------------
43
44 If the 'rules' file is contained in the testcase, this file defines
45 a set of Makefile.rules this testcase can be applied to. If there is
46 no rules file, this testcase is applied to all the rules.
47
48 The rules file contains one line of one of the following forms:
49
50 * <rules name> - This selects only one rules file
51
52 * all: - this selects all the rules files
53
54 * snip:<snippet name> - this selects all the rules, which contain the
55   given snippet.
56
57 * python:<python exression> - The python expression is evaluated. The
58   global namespace contains the following variables:
59
60     - rules: the name of tested rules
61
62     - snippets: is of type list and contains the snippet names from
63       which the tested rules are composed.
64
65   If the expression evaluates as True, the testcase is executed with
66   this rules, otherwise it is not.
67
68   Example: python: "config_h" in snippets and rules != "rtems"