mirror of
https://github.com/sstephenson/bats.git
synced 2025-01-30 23:59:45 +01:00
b1eee9f455
- add bats.1 - add bats.7 - tweak install.sh to install manpages
157 lines
5.7 KiB
HTML
157 lines
5.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
|
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
|
<title>bats(1) - Bash Automated Testing System</title>
|
|
<style type='text/css' media='all'>
|
|
/* style: man */
|
|
body#manpage {margin:0}
|
|
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
|
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
|
.mp h2 {margin:10px 0 0 0}
|
|
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
|
.mp h3 {margin:0 0 0 4ex}
|
|
.mp dt {margin:0;clear:left}
|
|
.mp dt.flush {float:left;width:8ex}
|
|
.mp dd {margin:0 0 0 9ex}
|
|
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
|
.mp pre {margin-bottom:20px}
|
|
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
|
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
|
.mp img {display:block;margin:auto}
|
|
.mp h1.man-title {display:none}
|
|
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
|
.mp h2 {font-size:16px;line-height:1.25}
|
|
.mp h1 {font-size:20px;line-height:2}
|
|
.mp {text-align:justify;background:#fff}
|
|
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
|
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
|
.mp u {text-decoration:underline}
|
|
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
|
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
|
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
|
.mp b.man-ref {font-weight:normal;color:#434241}
|
|
.mp pre {padding:0 4ex}
|
|
.mp pre code {font-weight:normal;color:#434241}
|
|
.mp h2+pre,h3+pre {padding-left:0}
|
|
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
|
ol.man-decor {width:100%}
|
|
ol.man-decor li.tl {text-align:left}
|
|
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
|
ol.man-decor li.tr {text-align:right;float:right}
|
|
</style>
|
|
</head>
|
|
<!--
|
|
The following styles are deprecated and will be removed at some point:
|
|
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
|
|
|
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
|
.man-navigation should be used instead.
|
|
-->
|
|
<body id='manpage'>
|
|
<div class='mp' id='man'>
|
|
|
|
<div class='man-navigation' style='display:none'>
|
|
<a href="#NAME">NAME</a>
|
|
<a href="#SYNOPSIS">SYNOPSIS</a>
|
|
<a href="#DESCRIPTION">DESCRIPTION</a>
|
|
<a href="#FILES">FILES</a>
|
|
<a href="#OPTIONS">OPTIONS</a>
|
|
<a href="#EXAMPLES">EXAMPLES</a>
|
|
<a href="#COPYRIGHT">COPYRIGHT</a>
|
|
<a href="#SEE-ALSO">SEE ALSO</a>
|
|
</div>
|
|
|
|
<ol class='man-decor man-head man head'>
|
|
<li class='tl'>bats(1)</li>
|
|
<li class='tc'></li>
|
|
<li class='tr'>bats(1)</li>
|
|
</ol>
|
|
|
|
<h2 id="NAME">NAME</h2>
|
|
<p class="man-name">
|
|
<code>bats</code> - <span class="man-whatis">Bash Automated Testing System</span>
|
|
</p>
|
|
|
|
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
|
|
|
<p>bats [-c] [-p | -t] <var>test</var> [<var>test</var> ...]</p>
|
|
|
|
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
|
|
|
<p>Bats is a TAP-compliant testing framework for Bash.
|
|
It provides a simple way to verify that the UNIX programs you write behave as expected.</p>
|
|
|
|
<p>Bats is most useful when testing software written in Bash, but you can use it to test any UNIX program.</p>
|
|
|
|
<h2 id="FILES">FILES</h2>
|
|
|
|
<p>To run your tests, invoke the <code>bats</code> interpreter with a path to a test
|
|
file. The file's test cases are run sequentially and in isolation. If
|
|
all the test cases pass, <code>bats</code> exits with a <code>0</code> status code. If there
|
|
are any failures, <code>bats</code> exits with a <code>1</code> status code.</p>
|
|
|
|
<p>You can invoke the <code>bats</code> interpreter with multiple test file
|
|
arguments, or with a path to a directory containing multiple <code>.bats</code>
|
|
files. Bats will run each test file individually and aggregate the
|
|
results. If any test case fails, <code>bats</code> exits with a <code>1</code> status code.</p>
|
|
|
|
<h2 id="OPTIONS">OPTIONS</h2>
|
|
|
|
<dl>
|
|
<dt><code>-c</code>, <code>--count</code></dt><dd>Count the number of test cases without running any tests</dd>
|
|
<dt><code>-h</code>, <code>--help</code></dt><dd>Display this help message</dd>
|
|
<dt><code>-p</code>, <code>--pretty</code></dt><dd>Show results in pretty format (default for terminals)</dd>
|
|
<dt><code>-t</code>, <code>--tap</code></dt><dd>Show results in TAP format</dd>
|
|
<dt><code>-v</code>, <code>--version</code></dt><dd>Display the version number</dd>
|
|
</dl>
|
|
|
|
|
|
<h2 id="EXAMPLES">EXAMPLES</h2>
|
|
|
|
<p>When you run Bats from a terminal, you'll see output as each test is
|
|
performed, with a check-mark next to the test's name if it passes or
|
|
an "X" if it fails.</p>
|
|
|
|
<pre><code>$ bats addition.bats
|
|
✓ addition using bc
|
|
✓ addition using dc
|
|
|
|
2 tests, 0 failures
|
|
</code></pre>
|
|
|
|
<p>If Bats is not connected to a terminal—in other words, if you
|
|
run it from a continuous integration system or redirect its output to
|
|
a file—the results are displayed in human-readable, machine-parsable
|
|
<a href="http://testanything.org/wiki/index.php/TAP_specification#THE_TAP_FORMAT">TAP format</a>.
|
|
You can force TAP output from a terminal by invoking Bats with the
|
|
<code>--tap</code> option.</p>
|
|
|
|
<pre><code>$ bats --tap addition.bats
|
|
1..2
|
|
ok 1 addition using bc
|
|
ok 2 addition using dc
|
|
</code></pre>
|
|
|
|
<h2 id="COPYRIGHT">COPYRIGHT</h2>
|
|
|
|
<p>(c) 2013 Sam Stephenson.</p>
|
|
|
|
<p>Bats is released under an MIT-style license</p>
|
|
|
|
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
|
|
|
<p><a class="man-ref" href="bats.7.html">bats<span class="s">(7)</span></a></p>
|
|
|
|
|
|
<ol class='man-decor man-foot man foot'>
|
|
<li class='tl'></li>
|
|
<li class='tc'>November 2013</li>
|
|
<li class='tr'>bats(1)</li>
|
|
</ol>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|