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