diff --git a/doc/cmdtest.html b/doc/cmdtest.html index 2cf0152..0dfffa1 100644 --- a/doc/cmdtest.html +++ b/doc/cmdtest.html @@ -305,14 +305,17 @@ ul.auto-toc { <li><a class="reference internal" href="#structure-of-a-test-method" id="id5">Structure of a test-method</a></li> <li><a class="reference internal" href="#work-directory" id="id6">Work directory</a></li> <li><a class="reference internal" href="#matching-standard-output-content" id="id7">Matching standard output content</a></li> -<li><a class="reference internal" href="#invoking-cmdtest" id="id8">Invoking <tt class="docutils literal"><span class="pre">cmdtest</span></tt></a></li> -<li><a class="reference internal" href="#reference-part" id="id9">Reference Part</a><ul> -<li><a class="reference internal" href="#cmd" id="id10">cmd</a></li> -<li><a class="reference internal" href="#assertions-exit-status" id="id11">Assertions - exit status</a></li> -<li><a class="reference internal" href="#assertions-files" id="id12">Assertions - files</a></li> -<li><a class="reference internal" href="#assertions-stdout-stderr-file-content" id="id13">Assertions - stdout/stderr/file content</a></li> -<li><a class="reference internal" href="#assertions-misc" id="id14">Assertions - misc</a></li> -<li><a class="reference internal" href="#helper-functions" id="id15">Helper functions</a></li> +<li><a class="reference internal" href="#invoking-cmdtest" id="id8">Invoking <tt class="docutils literal"><span class="pre">cmdtest</span></tt></a><ul> +<li><a class="reference internal" href="#options" id="id9">Options</a></li> +</ul> +</li> +<li><a class="reference internal" href="#reference-part" id="id10">Reference Part</a><ul> +<li><a class="reference internal" href="#cmd" id="id11">cmd</a></li> +<li><a class="reference internal" href="#assertions-exit-status" id="id12">Assertions - exit status</a></li> +<li><a class="reference internal" href="#assertions-files" id="id13">Assertions - files</a></li> +<li><a class="reference internal" href="#assertions-stdout-stderr-file-content" id="id14">Assertions - stdout/stderr/file content</a></li> +<li><a class="reference internal" href="#assertions-misc" id="id15">Assertions - misc</a></li> +<li><a class="reference internal" href="#helper-functions" id="id16">Helper functions</a></li> </ul> </li> </ul> @@ -527,11 +530,47 @@ $ cmdtest CMDTEST_foo.rb CMDTEST_bar.rb # two files $ cmdtest t # all CMDTEST_*.rb files in "t" dir $ cmdtest . t # all CMDTEST_*.rb files in both dirs </pre> +<div class="section" id="options"> +<h2><a class="toc-backref" href="#id9">Options</a></h2> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">--help</span></kbd></td> +<td>Show available options.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--quiet</span></kbd></td> +<td>Be more quiet by skipping some non-essential output.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--verbose</span></kbd></td> +<td>Be more verbose.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--fast</span></kbd></td> +<td>Run fast without ensuring that timestamps of newly created/modfied +files are unique. This could make it impossible for Cmdtest to detect +all side-effects of commands.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--test=<var>NAME</var></span></kbd></td> +<td>Only run named test method.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--xml=<var>FILE</var></span></kbd></td> +<td>Write summary on JUnit XML format. +Useful when running under a continuouos integration server that +understands JUnit reports.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-i</span></kbd></td> +<td>Run in "incermental" mode. <strong>experimental</strong> +Cmdtest will try to run only those test methods that are failed or +have changed since last time.</td></tr> +</tbody> +</table> +</div> </div> <div class="section" id="reference-part"> -<h1><a class="toc-backref" href="#id9">Reference Part</a></h1> +<h1><a class="toc-backref" href="#id10">Reference Part</a></h1> <div class="section" id="cmd"> -<h2><a class="toc-backref" href="#id10">cmd</a></h2> +<h2><a class="toc-backref" href="#id11">cmd</a></h2> <p>The <tt class="docutils literal"><span class="pre">cmd</span></tt> method is the central method of the whole Cmdtest framework. It should always be called with a block like this:</p> <pre class="literal-block"> @@ -558,7 +597,7 @@ end <p>See also the example in the <a class="reference internal" href="#structure-of-a-test-method">Structure of a test-method</a> section above.</p> </div> <div class="section" id="assertions-exit-status"> -<h2><a class="toc-backref" href="#id11">Assertions - exit status</a></h2> +<h2><a class="toc-backref" href="#id12">Assertions - exit status</a></h2> <dl class="docutils"> <dt><tt class="docutils literal"><span class="pre">exit_nonzero</span></tt></dt> <dd>The command should have exited with a non-zero exit status (i.e. it @@ -572,7 +611,7 @@ exit-related methods have been called.</dd> </dl> </div> <div class="section" id="assertions-files"> -<h2><a class="toc-backref" href="#id12">Assertions - files</a></h2> +<h2><a class="toc-backref" href="#id13">Assertions - files</a></h2> <dl class="docutils"> <dt><tt class="docutils literal"><span class="pre">affected_files(file1,...,fileN)</span></tt></dt> <dd>The specified files should have been created, removed or modified by the @@ -598,7 +637,7 @@ case special (when the file is created).</dd> </dl> </div> <div class="section" id="assertions-stdout-stderr-file-content"> -<h2><a class="toc-backref" href="#id13">Assertions - stdout/stderr/file content</a></h2> +<h2><a class="toc-backref" href="#id14">Assertions - stdout/stderr/file content</a></h2> <dl class="docutils"> <dt><tt class="docutils literal"><span class="pre">file_equal(file,</span> <span class="pre">content)</span></tt></dt> <dd>Assert that the specified file matches the given content. @@ -622,7 +661,7 @@ For more details and examples see the section "Matching standard output con </dl> </div> <div class="section" id="assertions-misc"> -<h2><a class="toc-backref" href="#id14">Assertions - misc</a></h2> +<h2><a class="toc-backref" href="#id15">Assertions - misc</a></h2> <dl class="docutils"> <dt><tt class="docutils literal"><span class="pre">assert(flag,</span> <span class="pre">msg=nil)</span></tt></dt> <dd>Assert that <tt class="docutils literal"><span class="pre">flag</span></tt> is true. This assertion is a last resort, when no other @@ -630,7 +669,7 @@ assertion fits. Should normally not be used.</dd> </dl> </div> <div class="section" id="helper-functions"> -<h2><a class="toc-backref" href="#id15">Helper functions</a></h2> +<h2><a class="toc-backref" href="#id16">Helper functions</a></h2> <dl class="docutils"> <dt><tt class="docutils literal"><span class="pre">create_file(filename,</span> <span class="pre">content)</span></tt></dt> <dd>Create a file inside the "work directory". @@ -648,6 +687,11 @@ The <tt class="docutils literal"><span class="pre">src</span></tt> path is evalu when <tt class="docutils literal"><span class="pre">cmdtest</span></tt> was called. The <tt class="docutils literal"><span class="pre">tgt</span></tt> is evaluated relative to the current directory inside the "work directory" at the time of the call.</dd> +<dt><tt class="docutils literal"><span class="pre">prepend_local_path(dir)</span></tt></dt> +<dd>Prepend the given directory to the <tt class="docutils literal"><span class="pre">PATH</span></tt> so commands executed via <tt class="docutils literal"><span class="pre">cmd</span></tt> +are looked up using the modified <tt class="docutils literal"><span class="pre">PATH</span></tt>. The argument <tt class="docutils literal"><span class="pre">dir</span></tt> is evaluated +relative to the current directory in effect at the time of the call +(i.e. typically the "work directory" during the test).</dd> <dt><tt class="docutils literal"><span class="pre">prepend_path(dir)</span></tt></dt> <dd>Prepend the given directory to the <tt class="docutils literal"><span class="pre">PATH</span></tt> so commands executed via <tt class="docutils literal"><span class="pre">cmd</span></tt> are looked up using the modified <tt class="docutils literal"><span class="pre">PATH</span></tt>. A typical use is to add the directory @@ -664,7 +708,7 @@ time of the call.</dd> <div class="footer"> <hr class="footer" /> <a class="reference external" href="cmdtest.txt">View document source</a>. -Generated on: 2009-04-02. +Generated on: 2009-05-10. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div>