1 Description of Testcases for OMK
2 ================================
4 Each test resides in a separate directory. Every directory can
5 contains multiple testcases. The directories can be nested. There is
6 no difference between the tests in different levels of directory
9 Structure of a Testcase
10 -----------------------
12 A directory contains a testcase if it contains at least one file that
13 matches runtest* pattern (files ending with "~" or ".rules" are not
16 * Testcase Definition:
18 Each test is represented by a set of files. Some of these files are
19 used as "data" files for the test (e.g. source code, config.omk,
20 etc.) and some files controls how is the test run. Here follows the
21 description of control files in the test directory.
23 - runtest*: is the executable that runs the test(s). It is possible
24 to have more files in a test directory, whose name starts with
25 `runtest'. In that case all these files will be executed in
26 alphabetical order as separate testcases. The goal is to be able
27 to run several tests on the same structure of files and
30 - runtest*.rules: Specifies the set of rules the testcase applies
31 to. If there is more runtest files, every testcase can have its
32 own .rules file. The syntax of this files is describes in section
37 Runtest is executed with OMK_RULES environment variable set to the
38 name of the actual rules tested and OMK_TESTSROOT to the directory
39 containing the `tester.py' script.
43 Each execution of testcase should produce the following outputs:
45 - Exit status of make or runtest:
46 0 - the testcase was successfully passed
47 1 - the testcase failed
48 2 - the testcase cannot be executed (e.g. because the needed
49 compiler is not available)
52 In the case of error, the file '_error' should contain more
53 detailed description of the error.
55 - stdout and stderr: The output of testcase execution is captured
56 and is included in the results log. It should contain useful
57 information to ease debugging problems.
62 If the 'runtest*.rules' files are contained in the test directory,
63 this file defines a set of Makefile.rules the particular testcase can
64 be applied to. If there is no rules file, this testcase is applied to
67 The rules file contains one line of one of the following forms:
69 * <rules name> - This selects only one rules file
71 * all: - this selects all the rules files
73 * snip:<snippet name> - this selects all the rules, which contain the
76 * python:<python expression> - The python expression is evaluated. The
77 global namespace contains the following variables:
79 - rules: the name of tested rules
81 - snippets: is of type list and contains the snippet names from
82 which the tested rules are composed.
84 If the expression evaluates as True, the testcase is executed with
85 this rules, otherwise it is not.
87 Example: python: "config_h" in snippets and rules != "rtems"