]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/atf/doc/atf-test-program.1
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / atf / doc / atf-test-program.1
1 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
14 .\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
15 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
18 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
20 .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
24 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 .Dd March 2, 2014
26 .Dt ATF-TEST-PROGRAM 1
27 .Os
28 .Sh NAME
29 .Nm atf-test-program
30 .Nd common interface to ATF test programs
31 .Sh SYNOPSIS
32 .Nm
33 .Op Fl r Ar resfile
34 .Op Fl s Ar srcdir
35 .Op Fl v Ar var1=value1 Op .. Fl v Ar varN=valueN
36 .Ar test_case
37 .Nm
38 .Fl l
39 .Sh DESCRIPTION
40 Test programs written using the ATF libraries all share a common user
41 interface, which is what this manual page describes.
42 .Em NOTE: There is no binary known as
43 .Nm ;
44 .Em what is described in this manual page is the command-line interface
45 .Em exposed by the atf-c, atf-c++ and atf-sh bindings .
46 .Pp
47 In the first synopsis form, the test program will execute the provided
48 test case and print its results to the standard output, unless otherwise
49 stated by the
50 .Fl r
51 flag.
52 Optionally, the test case name can be suffixed by
53 .Sq :cleanup ,
54 in which case the cleanup routine of the test case will be executed
55 instead of the test case body; see
56 .Xr atf-test-case 4 .
57 Note that the test case is
58 .Em executed without isolation ,
59 so it can and probably will create and modify files in the current directory.
60 To execute test cases in a controller manner, you need a runtime engine
61 that understands the ATF interface.
62 The recommended runtime engine is
63 .Xr kyua 1 .
64 You should only execute test cases by hand for debugging purposes.
65 .Pp
66 In the second synopsis form, the test program will list all available
67 test cases alongside their meta-data properties in a format that is
68 machine parseable.
69 This list is processed by
70 .Xr kyua 1
71 to know how to execute the test cases of a given test program.
72 .Pp
73 The following options are available:
74 .Bl -tag -width XvXvarXvalueXX
75 .It Fl l
76 Lists available test cases alongside a brief description for each of them.
77 .It Fl r Ar resfile
78 Specifies the file that will receive the test case result.
79 If not specified, the test case prints its results to stdout.
80 If the result of a test case needs to be parsed by another program, you must
81 use this option to redirect the result to a file and then read the resulting
82 file from the other program.
83 Note:
84 .Em do not try to process the stdout of the test case
85 because your program may break in the future.
86 .It Fl s Ar srcdir
87 The path to the directory where the test program is located.
88 This is needed in all cases, except when the test program is being executed
89 from the current directory.
90 The test program will use this path to locate any helper data files or
91 utilities.
92 .It Fl v Ar var=value
93 Sets the configuration variable
94 .Ar var
95 to the value
96 .Ar value .
97 .El
98 .Sh SEE ALSO
99 .Xr kyua 1