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