Skip to content

Commit 102c91b

Browse files
nabijaczlewelibehlendorf
authored andcommitted
Widen mancheck to all of man and test-runner
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12125
1 parent 4910903 commit 102c91b

File tree

2 files changed

+55
-44
lines changed

2 files changed

+55
-44
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ checkbashisms:
170170
PHONY += mancheck
171171
mancheck:
172172
@if type mandoc > /dev/null 2>&1; then \
173-
find ${top_srcdir}/man/man8 -type f -name '*[1-9]*' \
173+
find ${top_srcdir}/man ${top_srcdir}/tests/test-runner/man -type f -name '*[1-9]*' \
174174
-exec mandoc -Tlint -Werror {} \+; \
175175
else \
176176
echo "skipping mancheck because mandoc is not installed"; \

tests/test-runner/man/test-runner.1

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
.\" source. A copy of the CDDL is also available via the Internet at
99
.\" http://www.illumos.org/license/CDDL.
1010
.\"
11-
.\"
1211
.\" Copyright (c) 2012 by Delphix. All rights reserved.
1312
.\"
14-
.Dd March 10, 2020
13+
.Dd May 26, 2021
1514
.Dt RUN 1
1615
.Os
1716
.
@@ -45,24 +44,28 @@
4544
.
4645
.Sh DESCRIPTION
4746
.Nm
48-
command has three basic modes of operation. With neither
47+
command has three basic modes of operation.
48+
With neither
4949
.Fl c
5050
nor
5151
.Fl w ,
5252
.Nm
5353
processes the arguments provided on
54-
the command line, adding them to the list for this run. If a specified
54+
the command line, adding them to the list for this run.
55+
If a specified
5556
.Ar pathname
56-
is an executable file, it is added as a test. If a specified
57+
is an executable file, it is added as a test.
58+
If a specified
5759
.Ar pathname
5860
is a directory, the behavior depends upon the presence of
5961
.Fl g .
6062
If
6163
.Fl g
62-
is specified, the directory is treated as a test group. See the
63-
section on
64+
is specified, the directory is treated as a test group.
65+
See the section on
6466
.Sy Test Groups
65-
below. Without
67+
below.
68+
Without
6669
.Fl g ,
6770
.Nm
6871
simply descends into the directory looking for executable files.
@@ -76,8 +79,8 @@ Rather than executing the tests and logging the results, the test configuration
7679
is stored in a
7780
.Ar runfile ,
7881
which can be used in future invocations, or edited
79-
to modify which tests are executed and which options are applied. Options
80-
included on the command line with
82+
to modify which tests are executed and which options are applied.
83+
Options included on the command line with
8184
.Fl w
8285
become defaults in the
8386
.Ar runfile .
@@ -92,20 +95,23 @@ The tests are then executed, and the results are logged.
9295
.
9396
.Ss Test Groups
9497
A test group is comprised of a set of executable files, all of which exist in
95-
one directory. The options specified on the command line or in a
98+
one directory.
99+
The options specified on the command line or in a
96100
.Ar runfile
97-
apply to individual tests in the group. The exception is options pertaining to
98-
pre and post scripts, which act on all tests as a group. Rather than running
99-
before and after each test, these scripts are run only once each at the start
100-
and end of the test group.
101+
apply to individual tests in the group.
102+
The exception is options pertaining to pre and post scripts, which act on all tests as a group.
103+
Rather than running before and after each test,
104+
these scripts are run only once each at the start and end of the test group.
101105
.Ss Test Execution
102106
The specified tests run serially, and are typically assigned results according
103-
to exit values. Tests that exit zero and non-zero are marked
107+
to exit values.
108+
Tests that exit zero and non-zero are marked
104109
.Sy PASS
105110
and
106111
.Sy FAIL ,
107-
respectively. When a pre script fails for a test group, only the post script is
108-
executed, and the remaining tests are marked
112+
respectively.
113+
When a pre script fails for a test group, only the post script is executed,
114+
and the remaining tests are marked
109115
.Sy SKIPPED .
110116
Any test that exceeds
111117
its
@@ -114,30 +120,31 @@ is terminated, and marked
114120
.Sy KILLED .
115121
.Pp
116122
By default, tests are executed with the credentials of the
117-
.Sy
123+
.Nm
118124
script.
119125
Executing tests with other credentials is done via
120126
.Xr sudo 1m ,
121127
which must
122-
be configured to allow execution without prompting for a password. Environment
123-
variables from the calling shell are available to individual tests. During test
124-
execution, the working directory is changed to
128+
be configured to allow execution without prompting for a password.
129+
Environment variables from the calling shell are available to individual tests.
130+
During test execution, the working directory is changed to
125131
.Ar outputdir .
126132
.
127133
.Ss Output Logging
128134
By default,
129135
.Nm
130136
will print one line on standard output at the conclusion
131-
of each test indicating the test name, result and elapsed time. Additionally,
132-
for each invocation of
137+
of each test indicating the test name, result and elapsed time.
138+
Additionally, for each invocation of
133139
.Nm ,
134-
a directory is created using the ISO 8601
135-
date format. Within this directory is a file named
140+
a directory is created using the ISO 8601 date format.
141+
Within this directory is a file named
136142
.Sy log
137143
containing all the
138-
test output with timestamps, and a directory for each test. Within the test
139-
directories, there is one file each for standard output, standard error and
140-
merged output. The default location for the
144+
test output with timestamps, and a directory for each test.
145+
Within the test directories, there is one file each for standard output,
146+
standard error and merged output.
147+
The default location for the
141148
.Ar outputdir
142149
is
143150
.Pa /var/tmp/test_results .
@@ -150,11 +157,12 @@ The file has one section named
150157
which contains configuration option
151158
names and their values in
152159
.Sy name No = Ar value
153-
format. The values in this section
154-
apply to all the subsequent sections, unless they are also specified there, in
155-
which case the default is overridden. The remaining section names are the
156-
absolute pathnames of files and directories, describing tests and test groups
157-
respectively. The legal option names are:
160+
format.
161+
The values in this section apply to all the subsequent sections,
162+
unless they are also specified there, in which case the default is overridden.
163+
The remaining section names are the absolute pathnames of files and directories,
164+
describing tests and test groups respectively.
165+
The legal option names are:
158166
.Bl -tag -width "tests = ['filename', …]"
159167
.It Sy outputdir No = Ar pathname
160168
The name of the directory that holds test logs.
@@ -176,11 +184,12 @@ Execute the post script as
176184
If
177185
.Sy True ,
178186
only the results summary is printed to standard out.
179-
.It Sy tests No = [ Ns Ar 'filename' Ns , ]
187+
.It Sy tests No = [ Ns Ar 'filename' , No ]
180188
Specify a list of
181189
.Ar filenames
182-
for this test group. Only the basename of the
183-
absolute path is required. This option is only valid for test groups, and each
190+
for this test group.
191+
Only the basename of the absolute path is required.
192+
This option is only valid for test groups, and each
184193
.Ar filename
185194
must be single quoted.
186195
.It Sy timeout No = Ar n
@@ -199,8 +208,8 @@ Specify a
199208
.Ar runfile
200209
to be consumed by the run command.
201210
.It Fl d
202-
Dry run mode. Execute no tests, but print a description of each test that would
203-
have been run.
211+
Dry run mode.
212+
Execute no tests, but print a description of each test that would have been run.
204213
.It Fl g
205214
Create test groups from any directories found while searching for tests.
206215
.It Fl o Ar outputdir
@@ -217,13 +226,15 @@ after any test or test group.
217226
Print only the results summary to the standard output.
218227
.It Fl s Ar script
219228
Run
220-
.Ar script as a failsafe after any test is killed.
229+
.Ar script
230+
as a failsafe after any test is killed.
221231
.It Fl S Ar username
222232
Execute the failsafe script as
223233
.Ar username .
224234
.It Fl t Ar n
225235
Specify a timeout value of
226-
.Ar n seconds per test.
236+
.Ar n
237+
seconds per test.
227238
.It Fl u Ar username
228239
Execute tests or test groups as
229240
.Ar username .
@@ -241,7 +252,7 @@ Execute the post script as
241252
.
242253
.Sh EXAMPLES
243254
.Bl -tag -width "-h"
244-
.It Sy Example 1 Ns : Running ad-hoc tests.
255+
.It Sy Example 1 : No Running ad-hoc tests.
245256
This example demonstrates the simplest invocation of
246257
.Nm .
247258
.Bd -literal
@@ -257,7 +268,7 @@ Running Time: 00:00:07
257268
Percent passed: 100.0%
258269
Log directory: /var/tmp/test_results/20120923T180654
259270
.Ed
260-
.It Sy Example 2 Ns : Creating a Ar runfile No for future use.
271+
.It Sy Example 2 : No Creating a Ar runfile No for future use.
261272
This example demonstrates creating a
262273
.Ar runfile
263274
with non-default options.

0 commit comments

Comments
 (0)