Query: atf-check
OS: netbsd
Section: 1
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
ATF-CHECK(1) BSD General Commands Manual ATF-CHECK(1)NAMEatf-check -- executes a command and analyzes its resultsSYNOPSISatf-check [-s qual:value] [-o action:arg ...] [-e action:arg ...] [-x] command atf-check -hDESCRIPTIONatf-check executes a given command and analyzes its results, including exit code, stdout and stderr. In the first synopsis form, atf-check will execute the provided command and apply checks specified by arguments. By default it will act as if it was run with -s exit:0 -o empty -e empty. Multiple checks for the same output channel are allowed and, if specified, their results will be combined as a logical and (meaning that the output must match all the provided checks). In the second synopsis form, atf-check will print information about all supported options and their purpose. The following options are available: -h Shows a short summary of all available options and their purpose. -s qual:value Analyzes termination status. Must be one of: exit:<value> checks that the program exited cleanly and that its exit status is equal to value. The exit code can be omit- ted altogether, in which case any clean exit is accepted. ignore ignores the exit check. signal:<value> checks that the program exited due to a signal and that the signal that terminated it is value. The signal can be specified both as a number or as a name, or it can also be omitted altogether, in which case any signal is accepted. Most of these checkers can be prefixed by the 'not-' string, which effectively reverses the check. -o action:arg Analyzes standard output. Must be one of: empty checks that stdout is empty ignore ignores stdout file:<path> compares stdout with given file inline:<value> compares stdout with inline value match:<regexp> looks for a regular expression in stdout save:<path> saves stdout to given file Most of these checkers can be prefixed by the 'not-' string, which effectively reverses the check. -e action:arg Analyzes standard error (syntax identical to above) -x Executes command as a shell command line, executing it with the system shell defined by ATF_SHELL in atf-config(1). You should avoid using this flag if at all possible to prevent shell quoting issues.EXIT STATUSatf-check exits 0 on success, and other (unspecified) value on failure.EXAMPLES# Exit code 0, nothing on stdout/stderr atf-check 'true' # Typical usage if failure is expected atf-check -s not-exit:0 'false' # Checking stdout/stderr echo foobar >expout atf-check -o file:expout -e inline:"xx yy " 'echo foobar ; printf "xx yy " >&2' # Checking for a crash atf-check -s signal:sigsegv my_program # Combined checks atf-check -o match:foo -o not-match:bar echo foo bazSEE ALSOatf-config(1), atf(7)BSDJune 27, 2010 BSD
Related Man Pages |
---|
atf-test-program(1) - freebsd |
atf-run(1) - netbsd |
atf-test-program(1) - netbsd |
atf-formats(5) - netbsd |
atf-sh-api(3) - freebsd |
Similar Topics in the Unix Linux Community |
---|
Check for exit status |
stdout to file or character device with trailing slash |
Empty file check |
Correctly evaluating the exit status |
Debian, string in string. |