NIHTEST-CASE(5) | File Formats Manual | NIHTEST-CASE(5) |
nihtest-case
—
test case format for nihtest
nihtest(1) is a testing tool. It uses .test files as input. This man page describes the format of these test files.
Lines beginning with “#” are comments.
The following commands are recognized. The
return
and args
commands
must appear exactly once, the others are optional.
arguments
[argument ...]description
textdirectory
name create [result]environment-clear
environment-passthrough
variable ...environment-set
variable valueenvironment-unset
variable ...features
feature ...FOO
is defined in the file, the feature
FOO
is assumed to be available, otherwise not. See
also the description of top-build-directory
in
nihtest-config(5).file
name in [out]“{}” specifies that the file does not exist (i. e. that it is created or deleted by the program).
For “<inline>” the contents of the file are taken from the test case, up to a line consisting of “end-of-inline-data”. If both in and out are “<inline>”, the input data comes first. Otherwise the argument specifies the name of the file to copy or compare against.
mkdir
namedirectory
name <> instead.precheck
command [argument ...]preload
objectThis is not supported on macOS and Windows, where tests with
preload
will be skipped.
program
namearguments
above for its command line arguments. If
this directive is omitted, default-program
from
nihtest.conf is run.read-only
namereturn
exit-codeset-modification-time
file timestderr
[file]stderr-replace
pattern replacementstderr
before
comparing them. pattern is the match expression,
replacement is the replacement expression. In the
replacement expression, “$1” to “$9” are
replaced with the content of the corresponding “(...)” match
in the pattern. See
re_format(7) for details.stdin
[file]Otherwise the text provided to the program via a pipe is taken from the test case, up to a line consisting of “end-of-inline-data”.
stdout
[file]stdout-replace
pattern replacementstdout
before
comparing them. See stderr-replace
for
details.test-case-source
filenameworking-directory
directoryDecember 17, 2024 | NiH |