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