2 .\" Automated Testing Framework (atf)
4 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 .\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 .Nd machine-parseable data formats used by ATF
36 This manual page describes the multiple data formats used in ATF.
37 These formats affect configuration files, control files and any data that
38 is externalized or internalized by the tools.
40 Data files are always organized as follows:
41 .Bd -literal -offset indent
46 Free-form text contents \\
51 A file must always contain a
53 header and must always separate that header from the body with a blank
54 line, even if the body is empty.
58 is always of the form:
59 .Bd -literal -offset indent
60 Content-Type: application/X-atf-<subtype>; version="<version>"
65 indicates the specific file format and
68 This header must be the first one of the file.
70 The main purpose of the
72 header, aside from determining the format used in the file, is to allow
73 future changes to a given format.
74 Whenever an incompatible change is made, the version is bumped by one.
75 By keeping the header in the first line, future versions may even remove
76 the need for such a header -- e.g. if some format was replaced by XML
77 files, which have their own mandatory header.
79 The rest of this document details the different format types.
80 .Ss Format: application/X-atf-atffile, version: 1
81 Atffiles are logically divided into three sections:
84 Test programs: the list of test programs that define the test suite
85 described by the Atffile.
87 Meta-data properties: these define some constant values applicable to
88 all the test programs defined in the file.
89 In some sense they define the properties that describe the test suite.
91 Configuration variables: defaults for configuration variables that
92 can be overridden through configuration files or the command line.
95 The grammar for Atffiles is the following:
96 .Bd -literal -offset indent
97 DATA ::= ( ( CONF | PROP | TP )? COMMENT? NEWLINE )* EOF
98 CONF ::= 'conf:' WORD EQUAL STRING
99 PROP ::= 'prop:' WORD EQUAL STRING
100 TP ::= TPFILE | TPGLOB
101 TPFILE ::= 'tp: ' STRING
102 TPGLOB ::= 'tp-glob: ' STRING
103 STRING ::= WORD | '"' WORD* '"'
106 The meaning of the constructions above is:
107 .Bl -tag -width TPGLOBXX
109 Definition of a configuration variable.
111 Definition of a meta-data property.
113 Addition of a test program into the test suite.
114 The string is taken literally as the program's name, and this program
117 Addition of multiple test programs into the test suite.
118 The string is taken as a glob pattern, which may have or not have any
119 matches in the current directory.
123 .Bd -literal -offset indent
124 prop: test-suite = utilities
126 conf: unprivileged-user = nobody
133 .Ss Format: application/X-atf-config, version: 1
134 Configuration files are very simple: they only contain a list of variable
135 name/variable value pairs.
137 .Bd -literal -offset indent
138 DATA ::= ( VAR? COMMENT? NEWLINE )* EOF
139 VAR ::= WORD EQUAL STRING
140 COMMENT ::= HASH WORD*
141 STRING ::= WORD | '"' WORD* '"'
145 .Bd -literal -offset indent
146 # This is the system-wide configuration file for ATF.
147 # The above and this line are comments placed on their own line.
149 var1 = this is a variable value
150 var2 = this is another one # Optional comment at the end.
152 .Ss Format: application/X-atf-tps, version: 3
154 .Sq application/X-atf-tps
155 format multiplexes the standard output, standard error and results output
156 streams from multiple test programs into a single data file.
157 This format is used by
159 to report the execution of several test programs and is later parsed by
161 to inform the user of this process.
162 It has the following grammar:
163 .Bd -literal -offset indent
164 DATA ::= INFO* TPS-COUNT TP-STANZA* INFO* EOF
165 INFO ::= 'info' COLON STRING COMMA STRING NEWLINE
166 TPS-COUNT ::= 'tps-count' COLON POSITIVE-NUMBER NEWLINE
167 TP-STANZA ::= TP-START TC-STANZA* TC-END
168 TP-START ::= 'tp-start' COLON TIMESTAMP COMMA STRING COMMA
169 POSITIVE-NUMBER NEWLINE
170 TP-END ::= 'tc-end' COLON TIMESTAMP COMMA STRING (COMMA STRING)?
171 TC-STANZA ::= TC-START (TC-SO | TC-SE)* TC-END
172 TC-START ::= 'tc-start' COLON TIMESTAMP COMMA STRING NEWLINE
173 TC-SO ::= 'tc-so' COLON STRING NEWLINE
174 TC-SE ::= 'tc-se' COLON STRING NEWLINE
175 TC-END ::= 'tc-end' COLON TIMESTAMP COMMA STRING COMMA TCR NEWLINE
176 TCR ::= 'passed' | ('failed' | 'skipped') COMMA STRING
177 TIMESTAMP ::= [0-9]+.[0-9]+
180 The meaning of the constructions above is:
181 .Bl -tag -width TPSXCOUNTXX
183 Indicates the number of test programs that will be executed.
184 There will be this exact amount of
186 constructions following it.
188 Indicates the beginning of a test program.
189 This includes the program's name and the amount of test cases that
192 Indicates the completion of a test program.
193 This is followed by the program's name and, if the program ended
194 prematurely, an error message indicating the reason of its failure.
195 A successful execution of a test program (regardless of the status of its
196 test cases) must not be accompanied by any reason.
198 Indicates the beginning of a test case.
199 This is accompanied by the test case's name.
201 Contains a text line sent to the standard output stream during the
202 execution of the test case.
203 Leading and trailing space is preserved.
205 Contains a text line sent to the standard error stream during the
206 execution of the test case.
207 Leading and trailing space is preserved.
209 Indicates the completion of a test case.
210 This is accompanied by the test case's name, its result and the reason
211 associated with this result (if applicable).
215 .Bd -literal -offset indent
217 tp-start: calculator, 1324318951.838923, 2
218 tc-start: add, 1324318951.839101
219 tc-end: add, 1324318951.839500, passed
220 tc-start: subtract, 1324318951.840001
221 tc-so: 3-2 expected to return 1 but got 0
222 tc-end: subtract, 1324318952.000123, failed, Calculated an unexpected value
223 tp-end: calculator, 1324318952.002301
224 tp-start: files, 1, 1324318952.502348
225 tc-start: copy, 1324318952.508291
226 tc-se: could not find the cp(1) utility
227 tc-end: copy, 1324318953.203145, skipped
228 tp-end: files, 1324318953.203800