<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="Up" href="OUnit2.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="OUnit" rel="Chapter" href="OUnit.html"> <link title="OUnit2" rel="Chapter" href="OUnit2.html"> <link title="OUnitThreads" rel="Chapter" href="OUnitThreads.html"> <link title="OUnitUtils" rel="Chapter" href="OUnitUtils.html"> <link title="OUnitPropList" rel="Chapter" href="OUnitPropList.html"> <link title="OUnitPlugin" rel="Chapter" href="OUnitPlugin.html"> <link title="OUnitChooser" rel="Chapter" href="OUnitChooser.html"> <link title="OUnitResultSummary" rel="Chapter" href="OUnitResultSummary.html"> <link title="OUnitLoggerStd" rel="Chapter" href="OUnitLoggerStd.html"> <link title="OUnitLoggerHTML" rel="Chapter" href="OUnitLoggerHTML.html"> <link title="OUnitLoggerHTMLData" rel="Chapter" href="OUnitLoggerHTMLData.html"> <link title="OUnitLoggerJUnit" rel="Chapter" href="OUnitLoggerJUnit.html"> <link title="OUnitAssert" rel="Chapter" href="OUnitAssert.html"> <link title="OUnitBracket" rel="Chapter" href="OUnitBracket.html"> <link title="OUnitTest" rel="Chapter" href="OUnitTest.html"> <link title="OUnitState" rel="Chapter" href="OUnitState.html"> <link title="OUnitRunner" rel="Chapter" href="OUnitRunner.html"> <link title="OUnitRunnerProcesses" rel="Chapter" href="OUnitRunnerProcesses.html"> <link title="OUnitCore" rel="Chapter" href="OUnitCore.html"> <link title="OUnitLogger" rel="Chapter" href="OUnitLogger.html"> <link title="OUnitConf" rel="Chapter" href="OUnitConf.html"> <link title="OUnitShared" rel="Chapter" href="OUnitShared.html"> <link title="OUnitCache" rel="Chapter" href="OUnitCache.html"> <link title="OUnitTestData" rel="Chapter" href="OUnitTestData.html"> <link title="OUnitCheckEnv" rel="Chapter" href="OUnitCheckEnv.html"> <link title="OUnitDiff" rel="Chapter" href="OUnitDiff.html"><title>OUnit user guide : OUnit2.Conf</title> </head> <body> <div class="navbar"> <a class="up" href="OUnit2.html" title="OUnit2">Up</a> </div> <h1>Module <a href="type_OUnit2.Conf.html">OUnit2.Conf</a></h1> <pre><span class="keyword">module</span> Conf: <code class="code"><span class="keyword">sig</span></code> <a href="OUnit2.Conf.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info module top"> Define command line options, environment variables and file configuration. <p> This module helps to define configuration options that are translated to command line options et al. <p> The name defined for the variable is:<ul> <li>should be a valid OCaml identifier</li> <li>kept as is for use in configuration file. (foo_bar = "")</li> <li>'_' are replaced by '-' and a leading '-' is added for command line (-foo "")</li> <li>capitalized and prefixed by OUNIT_ for environment (OUNIT_FOO_BAR="")</li> </ul> <br> </div> <hr width="100%"> <pre><span id="TYPEconf_t"><span class="keyword">type</span> <code class="type">'a</code> conf_t</span> = <code class="type">string -> 'a -> Arg.doc -> <a href="OUnit2.html#TYPEtest_ctxt">OUnit2.test_ctxt</a> -> 'a</code> </pre> <div class="info "> The default type of function that create a configuration option of type 'a.<br> </div> <pre><span id="VALmake_string"><span class="keyword">val</span> make_string</span> : <code class="type">string <a href="OUnit2.Conf.html#TYPEconf_t">conf_t</a></code></pre><div class="info "> <code class="code">make_string name default help</code> Create a string configuration option with default value <code class="code">default</code> and a short help string. The result of the partial application of the function can be used inside tests to be evaluated to a value. <p> <pre class="codepre"><code class="code"><span class="keyword">let</span> my_option = <span class="constructor">Conf</span>.make_string <span class="string">"my_option"</span> <span class="string">"the default"</span> <span class="string">"A default option."</span><br> <br> <span class="keyword">let</span> tests =<br> <span class="string">"ATest"</span> >::<br> (<span class="keyword">fun</span> test_ctxt <span class="keywordsign">-></span> <span class="keyword">let</span> option_value = my_option test_ctxt <span class="keyword">in</span> ())<br> <br> </code></pre><br> </div> <pre><span id="VALmake_string_opt"><span class="keyword">val</span> make_string_opt</span> : <code class="type">string option <a href="OUnit2.Conf.html#TYPEconf_t">conf_t</a></code></pre><div class="info "> Create a <code class="code">string option</code> configuration option. See <code class="code">!make_string</code>.<br> </div> <pre><span id="VALmake_int"><span class="keyword">val</span> make_int</span> : <code class="type">int <a href="OUnit2.Conf.html#TYPEconf_t">conf_t</a></code></pre><div class="info "> Create an <code class="code">int</code> configuration option. See <code class="code">!make_string</code>.<br> </div> <pre><span id="VALmake_float"><span class="keyword">val</span> make_float</span> : <code class="type">float <a href="OUnit2.Conf.html#TYPEconf_t">conf_t</a></code></pre><div class="info "> Create a <code class="code">float</code> configuration option. See <code class="code">!make_string</code>.<br> </div> <pre><span id="VALmake_bool"><span class="keyword">val</span> make_bool</span> : <code class="type">bool <a href="OUnit2.Conf.html#TYPEconf_t">conf_t</a></code></pre><div class="info "> Create a <code class="code">bool</code> configuration option. See <code class="code">!make_string</code>.<br> </div> <pre><span id="VALmake_exec"><span class="keyword">val</span> make_exec</span> : <code class="type">string -> <a href="OUnit2.html#TYPEtest_ctxt">OUnit2.test_ctxt</a> -> string</code></pre><div class="info "> <code class="code">make_exec execname</code> Create a option to define an executable.<br> </div> </body></html>