diff options
Diffstat (limited to 'contrib/atf/atf-sh/atf-sh-api.3')
-rw-r--r-- | contrib/atf/atf-sh/atf-sh-api.3 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/atf/atf-sh/atf-sh-api.3 b/contrib/atf/atf-sh/atf-sh-api.3 index 247b52c..d63804c 100644 --- a/contrib/atf/atf-sh/atf-sh-api.3 +++ b/contrib/atf/atf-sh/atf-sh-api.3 @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 28, 2010 +.Dd October 13, 2013 .Dt ATF-SH-API 3 .Os .Sh NAME @@ -320,18 +320,21 @@ This example demonstrates the use of the very useful function: .Bd -literal -offset indent # Check for silent output -atf_check 'true' 0 null null +atf_check -s exit:0 -o empty -e empty 'true' # Check for silent output and failure -atf_check 'false' 1 null null +atf_check -s exit:1 -o empty -e empty 'false' # Check for known stdout and silent stderr echo foo >expout -atf_check 'echo foo' 0 expout null +atf_check -s exit:0 -o file:expout -e empty 'echo foo' # Generate a file for later inspection -atf_check 'ls' 0 stdout null +atf_check -s exit:0 -o save:stdout -e empty 'ls' grep foo ls || atf_fail "foo file not found in listing" + +# Or just do the match along the way +atf_check -s exit:0 -o match:"^foo$" -e empty 'ls' .Ed .Sh SEE ALSO .Xr atf-sh 1 , |