diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2015-11-16 21:27:27 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2015-11-16 21:27:27 +0300 |
commit | b058b58bdea9a642f7c57445607e7d2bba63f10d (patch) | |
tree | 3d6049faf1d7364b221eb3e78a4f2f77ece09f72 | |
parent | 19b026ba6e6e5a5f3d3af8573c3641685c4291af (diff) | |
parent | a65f8f1c7855bdf3eb1d38bb948888f7086f770d (diff) | |
download | luacov-b058b58bdea9a642f7c57445607e7d2bba63f10d.tar.gz |
Merge pull request #36 from mpeterv/ldoc
Build reference using LDoc plus doc improvements
-rw-r--r-- | config.ld | 6 | ||||
-rw-r--r-- | doc/doc/files/src/luacov.html | 113 | ||||
-rw-r--r-- | doc/doc/files/src/luacov/defaults.html | 113 | ||||
-rw-r--r-- | doc/doc/files/src/luacov/reporter.html | 154 | ||||
-rw-r--r-- | doc/doc/files/src/luacov/reporter/default.html | 113 | ||||
-rw-r--r-- | doc/doc/files/src/luacov/runner.html | 529 | ||||
-rw-r--r-- | doc/doc/files/src/luacov/stats.html | 239 | ||||
-rw-r--r-- | doc/doc/files/src/luacov/tick.html | 113 | ||||
-rw-r--r-- | doc/doc/index.html | 126 | ||||
-rw-r--r-- | doc/doc/ldoc.css | 304 | ||||
-rw-r--r-- | doc/doc/luadoc.css | 286 | ||||
-rw-r--r-- | doc/doc/modules/luacov.defaults.html | 279 | ||||
-rw-r--r-- | doc/doc/modules/luacov.html | 73 | ||||
-rw-r--r-- | doc/doc/modules/luacov.reporter.html | 430 | ||||
-rw-r--r-- | doc/doc/modules/luacov.runner.html | 454 | ||||
-rw-r--r-- | doc/doc/modules/luacov.stats.html | 181 | ||||
-rw-r--r-- | doc/doc/modules/luacov.tick.html | 75 | ||||
-rw-r--r-- | src/luacov.lua | 8 | ||||
-rw-r--r-- | src/luacov/defaults.lua | 67 | ||||
-rw-r--r-- | src/luacov/reporter.lua | 52 | ||||
-rw-r--r-- | src/luacov/runner.lua | 49 | ||||
-rw-r--r-- | src/luacov/stats.lua | 2 | ||||
-rw-r--r-- | src/luacov/tick.lua | 1 |
23 files changed, 1955 insertions, 1812 deletions
diff --git a/config.ld b/config.ld new file mode 100644 index 0000000..8fb22a7 --- /dev/null +++ b/config.ld @@ -0,0 +1,6 @@ +project = "LuaCov" +description = "Coverage analysis tool for Lua scripts" +title = "LuaCov Reference" +dir = "doc/doc" +file = "src" +format = "markdown" diff --git a/doc/doc/files/src/luacov.html b/doc/doc/files/src/luacov.html deleted file mode 100644 index 19516dd..0000000 --- a/doc/doc/files/src/luacov.html +++ /dev/null @@ -1,113 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<head> - <title>Reference</title> - <link rel="stylesheet" href="../../luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> -</head> - -<body> -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><a href="../../index.html">Index</a></li> - -</ul> - - -<!-- Module list --> - - - -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li><strong>src/luacov.lua</strong></li> - - <li> - <a href="../../files/src/luacov/defaults.html">src/luacov/defaults.lua</a> - </li> - - <li> - <a href="../../files/src/luacov/reporter.html">src/luacov/reporter.lua</a> - </li> - - <li> - <a href="../../files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a> - </li> - - <li> - <a href="../../files/src/luacov/runner.html">src/luacov/runner.lua</a> - </li> - - <li> - <a href="../../files/src/luacov/stats.html">src/luacov/stats.lua</a> - </li> - - <li> - <a href="../../files/src/luacov/tick.html">src/luacov/tick.lua</a> - </li> - -</ul> - - - - - - -</div> <!-- id="navigation" --> - -<div id="content"> - -<h1>File <code>src/luacov.lua</code></h1> - - - - - - - - - - - - -<br/> -<br/> - - - - - - - - - - -</div> <!-- id="content" --> - -</div> <!-- id="main" --> - -<div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> -</div> <!-- id="about" --> - -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/doc/files/src/luacov/defaults.html b/doc/doc/files/src/luacov/defaults.html deleted file mode 100644 index b86e75a..0000000 --- a/doc/doc/files/src/luacov/defaults.html +++ /dev/null @@ -1,113 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<head> - <title>Reference</title> - <link rel="stylesheet" href="../../../luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> -</head> - -<body> -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><a href="../../../index.html">Index</a></li> - -</ul> - - -<!-- Module list --> - - - -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li> - <a href="../../../files/src/luacov.html">src/luacov.lua</a> - </li> - - <li><strong>src/luacov/defaults.lua</strong></li> - - <li> - <a href="../../../files/src/luacov/reporter.html">src/luacov/reporter.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/runner.html">src/luacov/runner.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/stats.html">src/luacov/stats.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/tick.html">src/luacov/tick.lua</a> - </li> - -</ul> - - - - - - -</div> <!-- id="navigation" --> - -<div id="content"> - -<h1>File <code>src/luacov/defaults.lua</code></h1> - - - - - - - - - - - - -<br/> -<br/> - - - - - - - - - - -</div> <!-- id="content" --> - -</div> <!-- id="main" --> - -<div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> -</div> <!-- id="about" --> - -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/doc/files/src/luacov/reporter.html b/doc/doc/files/src/luacov/reporter.html deleted file mode 100644 index f42827f..0000000 --- a/doc/doc/files/src/luacov/reporter.html +++ /dev/null @@ -1,154 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<head> - <title>Reference</title> - <link rel="stylesheet" href="../../../luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> -</head> - -<body> -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><a href="../../../index.html">Index</a></li> - -</ul> - - -<!-- Module list --> - - - -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li> - <a href="../../../files/src/luacov.html">src/luacov.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/defaults.html">src/luacov/defaults.lua</a> - </li> - - <li><strong>src/luacov/reporter.lua</strong></li> - - <li> - <a href="../../../files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/runner.html">src/luacov/runner.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/stats.html">src/luacov/stats.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/tick.html">src/luacov/tick.lua</a> - </li> - -</ul> - - - - - - -</div> <!-- id="navigation" --> - -<div id="content"> - -<h1>File <code>src/luacov/reporter.lua</code></h1> - - - - - - - -<h2>Functions</h2> -<table class="function_list"> - - <tr> - <td class="name" nowrap><a href="#reporter.report">reporter.report</a> (reporter_class)</td> - <td class="summary"> </td> - </tr> - -</table> - - - - - - -<br/> -<br/> - - - - -<h2><a name="functions"></a>Functions</h2> -<dl class="function"> - - - -<dt><a name="reporter.report"></a><strong>reporter.report</strong> (reporter_class)</dt> -<dd> - - - -<h3>Parameters</h3> -<ul> - - <li> - reporter_class: - </li> - -</ul> - - - - - - - - -</dd> - - -</dl> - - - - - - - -</div> <!-- id="content" --> - -</div> <!-- id="main" --> - -<div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> -</div> <!-- id="about" --> - -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/doc/files/src/luacov/reporter/default.html b/doc/doc/files/src/luacov/reporter/default.html deleted file mode 100644 index cebda35..0000000 --- a/doc/doc/files/src/luacov/reporter/default.html +++ /dev/null @@ -1,113 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<head> - <title>Reference</title> - <link rel="stylesheet" href="../../../../luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> -</head> - -<body> -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><a href="../../../../index.html">Index</a></li> - -</ul> - - -<!-- Module list --> - - - -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li> - <a href="../../../../files/src/luacov.html">src/luacov.lua</a> - </li> - - <li> - <a href="../../../../files/src/luacov/defaults.html">src/luacov/defaults.lua</a> - </li> - - <li> - <a href="../../../../files/src/luacov/reporter.html">src/luacov/reporter.lua</a> - </li> - - <li><strong>src/luacov/reporter/default.lua</strong></li> - - <li> - <a href="../../../../files/src/luacov/runner.html">src/luacov/runner.lua</a> - </li> - - <li> - <a href="../../../../files/src/luacov/stats.html">src/luacov/stats.lua</a> - </li> - - <li> - <a href="../../../../files/src/luacov/tick.html">src/luacov/tick.lua</a> - </li> - -</ul> - - - - - - -</div> <!-- id="navigation" --> - -<div id="content"> - -<h1>File <code>src/luacov/reporter/default.lua</code></h1> - - - - - - - - - - - - -<br/> -<br/> - - - - - - - - - - -</div> <!-- id="content" --> - -</div> <!-- id="main" --> - -<div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> -</div> <!-- id="about" --> - -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/doc/files/src/luacov/runner.html b/doc/doc/files/src/luacov/runner.html deleted file mode 100644 index a1fc748..0000000 --- a/doc/doc/files/src/luacov/runner.html +++ /dev/null @@ -1,529 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<head> - <title>Reference</title> - <link rel="stylesheet" href="../../../luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> -</head> - -<body> -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><a href="../../../index.html">Index</a></li> - -</ul> - - -<!-- Module list --> - - - -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li> - <a href="../../../files/src/luacov.html">src/luacov.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/defaults.html">src/luacov/defaults.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/reporter.html">src/luacov/reporter.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a> - </li> - - <li><strong>src/luacov/runner.lua</strong></li> - - <li> - <a href="../../../files/src/luacov/stats.html">src/luacov/stats.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/tick.html">src/luacov/tick.lua</a> - </li> - -</ul> - - - - - - -</div> <!-- id="navigation" --> - -<div id="content"> - -<h1>File <code>src/luacov/runner.lua</code></h1> - - - - - - - -<h2>Functions</h2> -<table class="function_list"> - - <tr> - <td class="name" nowrap><a href="#runner.excludefile">runner.excludefile</a> (name)</td> - <td class="summary">Adds a file to the exclude list (see <code>defaults.lua</code>).</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.excludetree">runner.excludetree</a> (name, level)</td> - <td class="summary">Adds a tree to the exclude list (see <code>defaults.lua</code>).</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.file_included">runner.file_included</a> (filename)</td> - <td class="summary">Uses LuaCov's configuration to check if a file is included for coverage data collection.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.includefile">runner.includefile</a> (name)</td> - <td class="summary">Adds a file to the include list (see <code>defaults.lua</code>).</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.includetree">runner.includetree</a> (name, level)</td> - <td class="summary">Adds a tree to the include list (see <code>defaults.lua</code>).</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.init">runner.init</a> (configuration)</td> - <td class="summary">Initializes LuaCov runner to start collecting data.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.load_config">runner.load_config</a> (configuration)</td> - <td class="summary">Loads a valid configuration.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.pause">runner.pause</a> ()</td> - <td class="summary">Pauses LuaCov's runner.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.real_name">runner.real_name</a> (filename)</td> - <td class="summary">Returns real name for a source file name using <code>modules</code> option.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.resume">runner.resume</a> ()</td> - <td class="summary">Resumes LuaCov's runner.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.run_report">runner.run_report</a> (configuration)</td> - <td class="summary">Runs the reporter specified in configuration.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.shutdown">runner.shutdown</a> ()</td> - <td class="summary">Shuts down LuaCov's runner.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#runner.update_stats">runner.update_stats</a> (old_stats, extra_stats)</td> - <td class="summary">Adds stats to an existing file stats table.</td> - </tr> - -</table> - - - - - - -<br/> -<br/> - - - - -<h2><a name="functions"></a>Functions</h2> -<dl class="function"> - - - -<dt><a name="runner.excludefile"></a><strong>runner.excludefile</strong> (name)</dt> -<dd> -Adds a file to the exclude list (see <code>defaults.lua</code>). If passed a function, then through debuginfo the source filename is collected. In case of a table it will recursively search the table for a function, which is then resolved to a filename through debuginfo. If the parameter is a string, it will first check if a file by that name exists. If it doesn't exist it will call <code>require(name)</code> to load a module by that name, and the result of require (function or table expected) is used as described above to get the sourcefile. - - -<h3>Parameters</h3> -<ul> - - <li> - name: string; literal filename, string; modulename as passed to require(), function; where containing file is looked up, table; module table where containing file is looked up - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -the pattern as added to the list, or nil + error - - - -</dd> - - - - -<dt><a name="runner.excludetree"></a><strong>runner.excludetree</strong> (name, level)</dt> -<dd> -Adds a tree to the exclude list (see <code>defaults.lua</code>). If <code>name = 'luacov'</code> and <code>level = nil</code> then module 'luacov' (luacov.lua) and the tree 'luacov' (containing `luacov/runner.lua` etc.) is excluded. If <code>name = 'pl.path'</code> and <code>level = true</code> then module 'pl' (pl.lua) and the tree 'pl' (containing `pl/path.lua` etc.) is excluded. NOTE: in case of an 'init.lua' file, the 'level' parameter will always be set - - -<h3>Parameters</h3> -<ul> - - <li> - name: see <code>excludefile</code> - </li> - - <li> - level: if truthy then one level up is added, including the tree - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -the 2 patterns as added to the list (file and tree), or nil + error - - - -</dd> - - - - -<dt><a name="runner.file_included"></a><strong>runner.file_included</strong> (filename)</dt> -<dd> -Uses LuaCov's configuration to check if a file is included for coverage data collection. - - -<h3>Parameters</h3> -<ul> - - <li> - filename: - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -true if file is included, false otherwise. - - - -</dd> - - - - -<dt><a name="runner.includefile"></a><strong>runner.includefile</strong> (name)</dt> -<dd> -Adds a file to the include list (see <code>defaults.lua</code>). - - -<h3>Parameters</h3> -<ul> - - <li> - name: see <code>excludefile</code> - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -the pattern as added to the list, or nil + error - - - -</dd> - - - - -<dt><a name="runner.includetree"></a><strong>runner.includetree</strong> (name, level)</dt> -<dd> -Adds a tree to the include list (see <code>defaults.lua</code>). - - -<h3>Parameters</h3> -<ul> - - <li> - name: see <code>excludefile</code> - </li> - - <li> - level: see <code>includetree</code> - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -the 2 patterns as added to the list (file and tree), or nil + error - - - -</dd> - - - - -<dt><a name="runner.init"></a><strong>runner.init</strong> (configuration)</dt> -<dd> -Initializes LuaCov runner to start collecting data. - - -<h3>Parameters</h3> -<ul> - - <li> - configuration: if string, filename of config file (used to call <code>load_config</code>). If table then config table (see file <code>luacov.default.lua</code> for an example) - </li> - -</ul> - - - - - - - - -</dd> - - - - -<dt><a name="runner.load_config"></a><strong>runner.load_config</strong> (configuration)</dt> -<dd> -Loads a valid configuration. - - -<h3>Parameters</h3> -<ul> - - <li> - configuration: user provided config (config-table or filename) - </li> - -</ul> - - - - - - -<h3>Return value:</h3> -existing configuration if already set, otherwise loads a new config from the provided data or the defaults. When loading a new config, if some options are missing, default values are used instead. - - - -</dd> - - - - -<dt><a name="runner.pause"></a><strong>runner.pause</strong> ()</dt> -<dd> -Pauses LuaCov's runner. Saves collected data and stops, allowing other processes to write to the same stats file. Data is still collected during pause. - - - - - - - - - -</dd> - - - - -<dt><a name="runner.real_name"></a><strong>runner.real_name</strong> (filename)</dt> -<dd> -Returns real name for a source file name using <code>modules</code> option. - - -<h3>Parameters</h3> -<ul> - - <li> - filename: - </li> - -</ul> - - - - - - - - -</dd> - - - - -<dt><a name="runner.resume"></a><strong>runner.resume</strong> ()</dt> -<dd> -Resumes LuaCov's runner. Reloads stats file, possibly updated from other processes, and continues saving collected data. - - - - - - - - - -</dd> - - - - -<dt><a name="runner.run_report"></a><strong>runner.run_report</strong> (configuration)</dt> -<dd> -Runs the reporter specified in configuration. - - -<h3>Parameters</h3> -<ul> - - <li> - configuration: if string, filename of config file (used to call <code>load_config</code>). If table then config table (see file <code>luacov.default.lua</code> for an example). If <code>configuration.reporter</code> is not set, runs the default reporter; otherwise, it must be a module name in 'luacov.reporter' namespace. The module must contain 'report' function, which is called without arguments. - </li> - -</ul> - - - - - - - - -</dd> - - - - -<dt><a name="runner.shutdown"></a><strong>runner.shutdown</strong> ()</dt> -<dd> -Shuts down LuaCov's runner. This should only be called from daemon processes or sandboxes which have disabled os.exit and other hooks that are used to determine shutdown. - - - - - - - - - -</dd> - - - - -<dt><a name="runner.update_stats"></a><strong>runner.update_stats</strong> (old_stats, extra_stats)</dt> -<dd> -Adds stats to an existing file stats table. - - -<h3>Parameters</h3> -<ul> - - <li> - old_stats: stats to be updated. - </li> - - <li> - extra_stats: another stats table, will be broken during update. - </li> - -</ul> - - - - - - - - -</dd> - - -</dl> - - - - - - - -</div> <!-- id="content" --> - -</div> <!-- id="main" --> - -<div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> -</div> <!-- id="about" --> - -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/doc/files/src/luacov/stats.html b/doc/doc/files/src/luacov/stats.html deleted file mode 100644 index d9d6edc..0000000 --- a/doc/doc/files/src/luacov/stats.html +++ /dev/null @@ -1,239 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<head> - <title>Reference</title> - <link rel="stylesheet" href="../../../luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> -</head> - -<body> -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><a href="../../../index.html">Index</a></li> - -</ul> - - -<!-- Module list --> - - - -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li> - <a href="../../../files/src/luacov.html">src/luacov.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/defaults.html">src/luacov/defaults.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/reporter.html">src/luacov/reporter.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/runner.html">src/luacov/runner.lua</a> - </li> - - <li><strong>src/luacov/stats.lua</strong></li> - - <li> - <a href="../../../files/src/luacov/tick.html">src/luacov/tick.lua</a> - </li> - -</ul> - - - - - - -</div> <!-- id="navigation" --> - -<div id="content"> - -<h1>File <code>src/luacov/stats.lua</code></h1> - - - - - - - -<h2>Functions</h2> -<table class="function_list"> - - <tr> - <td class="name" nowrap><a href="#stats.load">stats.load</a> ()</td> - <td class="summary">Loads the stats file.</td> - </tr> - - <tr> - <td class="name" nowrap><a href="#stats.save">stats.save</a> (data, fd)</td> - <td class="summary">Saves data to the statfile </td> - </tr> - - <tr> - <td class="name" nowrap><a href="#stats.start">stats.start</a> ()</td> - <td class="summary">Opens the statfile </td> - </tr> - - <tr> - <td class="name" nowrap><a href="#stats.stop">stats.stop</a> (fd)</td> - <td class="summary">Closes the statfile </td> - </tr> - -</table> - - - - - - -<br/> -<br/> - - - - -<h2><a name="functions"></a>Functions</h2> -<dl class="function"> - - - -<dt><a name="stats.load"></a><strong>stats.load</strong> ()</dt> -<dd> -Loads the stats file. - - - - - - - -<h3>Return value:</h3> -table with data. The table maps filenames to stats tables. Per-file tables map line numbers to hits or nils when there are no hits. Additionally, .max field contains maximum line number and .max_hits contains maximum number of hits in the file. - - - -</dd> - - - - -<dt><a name="stats.save"></a><strong>stats.save</strong> (data, fd)</dt> -<dd> -Saves data to the statfile - - -<h3>Parameters</h3> -<ul> - - <li> - data: data to store - </li> - - <li> - fd: filehandle where to store - </li> - -</ul> - - - - - - - - -</dd> - - - - -<dt><a name="stats.start"></a><strong>stats.start</strong> ()</dt> -<dd> -Opens the statfile - - - - - - - -<h3>Return value:</h3> -filehandle - - - -</dd> - - - - -<dt><a name="stats.stop"></a><strong>stats.stop</strong> (fd)</dt> -<dd> -Closes the statfile - - -<h3>Parameters</h3> -<ul> - - <li> - fd: filehandle to the statsfile - </li> - -</ul> - - - - - - - - -</dd> - - -</dl> - - - - - - - -</div> <!-- id="content" --> - -</div> <!-- id="main" --> - -<div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> -</div> <!-- id="about" --> - -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/doc/files/src/luacov/tick.html b/doc/doc/files/src/luacov/tick.html deleted file mode 100644 index 208d77a..0000000 --- a/doc/doc/files/src/luacov/tick.html +++ /dev/null @@ -1,113 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<head> - <title>Reference</title> - <link rel="stylesheet" href="../../../luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> -</head> - -<body> -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><a href="../../../index.html">Index</a></li> - -</ul> - - -<!-- Module list --> - - - -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li> - <a href="../../../files/src/luacov.html">src/luacov.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/defaults.html">src/luacov/defaults.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/reporter.html">src/luacov/reporter.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/runner.html">src/luacov/runner.lua</a> - </li> - - <li> - <a href="../../../files/src/luacov/stats.html">src/luacov/stats.lua</a> - </li> - - <li><strong>src/luacov/tick.lua</strong></li> - -</ul> - - - - - - -</div> <!-- id="navigation" --> - -<div id="content"> - -<h1>File <code>src/luacov/tick.lua</code></h1> - - - - - - - - - - - - -<br/> -<br/> - - - - - - - - - - -</div> <!-- id="content" --> - -</div> <!-- id="main" --> - -<div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> -</div> <!-- id="about" --> - -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/doc/index.html b/doc/doc/index.html index 6958fd2..8b2c9a7 100644 --- a/doc/doc/index.html +++ b/doc/doc/index.html @@ -1,13 +1,13 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <head> - <title>Reference</title> - <link rel="stylesheet" href="luadoc.css" type="text/css" /> - <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> + <title>LuaCov Reference</title> + <link rel="stylesheet" href="ldoc.css" type="text/css" /> </head> - <body> + <div id="container"> <div id="product"> @@ -16,123 +16,71 @@ <div id="product_description"></div> </div> <!-- id="product" --> -<div id="main"> - -<div id="navigation"> - - -<h1>LuaDoc</h1> -<ul> - - <li><strong>Index</strong></li> - -</ul> - - -<!-- Module list --> +<div id="main"> -<!-- File list --> - -<h1>Files</h1> -<ul> - - <li> - <a href="files/src/luacov.html">src/luacov.lua</a> - </li> - - <li> - <a href="files/src/luacov/defaults.html">src/luacov/defaults.lua</a> - </li> - - <li> - <a href="files/src/luacov/reporter.html">src/luacov/reporter.lua</a> - </li> +<!-- Menu --> - <li> - <a href="files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a> - </li> +<div id="navigation"> +<br/> +<h1>LuaCov</h1> - <li> - <a href="files/src/luacov/runner.html">src/luacov/runner.lua</a> - </li> - <li> - <a href="files/src/luacov/stats.html">src/luacov/stats.lua</a> - </li> - <li> - <a href="files/src/luacov/tick.html">src/luacov/tick.lua</a> - </li> +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="modules/luacov.html">luacov</a></li> + <li><a href="modules/luacov.defaults.html">luacov.defaults</a></li> + <li><a href="modules/luacov.reporter.html">luacov.reporter</a></li> + <li><a href="modules/luacov.runner.html">luacov.runner</a></li> + <li><a href="modules/luacov.stats.html">luacov.stats</a></li> + <li><a href="modules/luacov.tick.html">luacov.tick</a></li> </ul> - - - - - -</div> <!-- id="navigation" --> +</div> <div id="content"> + <h2>Coverage analysis tool for Lua scripts</h2> - - - - -<h2>Files</h2> -<table class="file_list"> -<!--<tr><td colspan="2">Files</td></tr>--> - +<h2>Modules</h2> +<table class="module_list"> <tr> - <td class="name"><a href="files/src/luacov.html">src/luacov.lua</a></td> - <td class="summary"></td> + <td class="name" nowrap><a href="modules/luacov.html">luacov</a></td> + <td class="summary">Loads <a href="modules/luacov.runner.html#">luacov.runner</a> and immediately starts it.</td> </tr> - <tr> - <td class="name"><a href="files/src/luacov/defaults.html">src/luacov/defaults.lua</a></td> - <td class="summary"></td> + <td class="name" nowrap><a href="modules/luacov.defaults.html">luacov.defaults</a></td> + <td class="summary">Default configuration file.</td> </tr> - <tr> - <td class="name"><a href="files/src/luacov/reporter.html">src/luacov/reporter.lua</a></td> - <td class="summary"></td> + <td class="name" nowrap><a href="modules/luacov.reporter.html">luacov.reporter</a></td> + <td class="summary">Report module, will transform statistics file into a report.</td> </tr> - <tr> - <td class="name"><a href="files/src/luacov/reporter/default.html">src/luacov/reporter/default.lua</a></td> - <td class="summary"></td> + <td class="name" nowrap><a href="modules/luacov.runner.html">luacov.runner</a></td> + <td class="summary">Statistics collecting module.</td> </tr> - <tr> - <td class="name"><a href="files/src/luacov/runner.html">src/luacov/runner.lua</a></td> - <td class="summary"></td> + <td class="name" nowrap><a href="modules/luacov.stats.html">luacov.stats</a></td> + <td class="summary">Manages the file with statistics (being) collected.</td> </tr> - <tr> - <td class="name"><a href="files/src/luacov/stats.html">src/luacov/stats.lua</a></td> - <td class="summary"></td> + <td class="name" nowrap><a href="modules/luacov.tick.html">luacov.tick</a></td> + <td class="summary">Load luacov using this if you want it to periodically + save the stats file.</td> </tr> - - <tr> - <td class="name"><a href="files/src/luacov/tick.html">src/luacov/tick.lua</a></td> - <td class="summary"></td> - </tr> - </table> - </div> <!-- id="content" --> - </div> <!-- id="main" --> - <div id="about"> - <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> +<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> +<i style="float:right;">Last updated 2015-11-16 21:06:14 </i> </div> <!-- id="about" --> - -</div> <!-- id="container" --> +</div> <!-- id="container" --> </body> </html> diff --git a/doc/doc/ldoc.css b/doc/doc/ldoc.css new file mode 100644 index 0000000..7a954f4 --- /dev/null +++ b/doc/doc/ldoc.css @@ -0,0 +1,304 @@ +/* BEGIN RESET + +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ +html { + color: #000; + background: #FFF; +} +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { + margin: 0; + padding: 0; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +fieldset,img { + border: 0; +} +address,caption,cite,code,dfn,em,strong,th,var,optgroup { + font-style: inherit; + font-weight: inherit; +} +del,ins { + text-decoration: none; +} +li { + list-style: disc; + margin-left: 20px; +} +caption,th { + text-align: left; +} +h1,h2,h3,h4,h5,h6 { + font-size: 100%; + font-weight: bold; +} +q:before,q:after { + content: ''; +} +abbr,acronym { + border: 0; + font-variant: normal; +} +sup { + vertical-align: baseline; +} +sub { + vertical-align: baseline; +} +legend { + color: #000; +} +input,button,textarea,select,optgroup,option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} +input,button,textarea,select {*font-size:100%; +} +/* END RESET */ + +body { + margin-left: 1em; + margin-right: 1em; + font-family: arial, helvetica, geneva, sans-serif; + background-color: #ffffff; margin: 0px; +} + +code, tt { font-family: monospace; font-size: 1.1em; } +span.parameter { font-family:monospace; } +span.parameter:after { content:":"; } +span.types:before { content:"("; } +span.types:after { content:")"; } +.type { font-weight: bold; font-style:italic } + +body, p, td, th { font-size: .95em; line-height: 1.2em;} + +p, ul { margin: 10px 0 0 0px;} + +strong { font-weight: bold;} + +em { font-style: italic;} + +h1 { + font-size: 1.5em; + margin: 20px 0 20px 0; +} +h2, h3, h4 { margin: 15px 0 10px 0; } +h2 { font-size: 1.25em; } +h3 { font-size: 1.15em; } +h4 { font-size: 1.06em; } + +a:link { font-weight: bold; color: #004080; text-decoration: none; } +a:visited { font-weight: bold; color: #006699; text-decoration: none; } +a:link:hover { text-decoration: underline; } + +hr { + color:#cccccc; + background: #00007f; + height: 1px; +} + +blockquote { margin-left: 3em; } + +ul { list-style-type: disc; } + +p.name { + font-family: "Andale Mono", monospace; + padding-top: 1em; +} + +pre { + background-color: rgb(245, 245, 245); + border: 1px solid #C0C0C0; /* silver */ + padding: 10px; + margin: 10px 0 10px 0; + overflow: auto; + font-family: "Andale Mono", monospace; +} + +pre.example { + font-size: .85em; +} + +table.index { border: 1px #00007f; } +table.index td { text-align: left; vertical-align: top; } + +#container { + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product { + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#main { + background-color: #f0f0f0; + border-left: 2px solid #cccccc; +} + +#navigation { + float: left; + width: 14em; + vertical-align: top; + background-color: #f0f0f0; + overflow: visible; +} + +#navigation h2 { + background-color:#e7e7e7; + font-size:1.1em; + color:#000000; + text-align: left; + padding:0.2em; + border-top:1px solid #dddddd; + border-bottom:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + margin: 1px 1px 10px 1px; +} + +#navigation li { + text-indent: -1em; + display: block; + margin: 3px 0px 0px 22px; +} + +#navigation li li a { + margin: 0px 3px 0px -1em; +} + +#content { + margin-left: 14em; + padding: 1em; + width: 700px; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + +#about { + clear: both; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +@media print { + body { + font: 12pt "Times New Roman", "TimeNR", Times, serif; + } + a { font-weight: bold; color: #004080; text-decoration: underline; } + + #main { + background-color: #ffffff; + border-left: 0px; + } + + #container { + margin-left: 2%; + margin-right: 2%; + background-color: #ffffff; + } + + #content { + padding: 1em; + background-color: #ffffff; + } + + #navigation { + display: none; + } + pre.example { + font-family: "Andale Mono", monospace; + font-size: 10pt; + page-break-inside: avoid; + } +} + +table.module_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.module_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.module_list td.summary { width: 100%; } + + +table.function_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.function_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.function_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.function_list td.summary { width: 100%; } + +ul.nowrap { + overflow:auto; + white-space:nowrap; +} + +dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} +dl.table h3, dl.function h3 {font-size: .95em;} + +/* stop sublists from having initial vertical space */ +ul ul { margin-top: 0px; } +ol ul { margin-top: 0px; } +ol ol { margin-top: 0px; } +ul ol { margin-top: 0px; } + +/* make the target distinct; helps when we're navigating to a function */ +a:target + * { + background-color: #FF9; +} + + +/* styles for prettification of source */ +pre .comment { color: #558817; } +pre .constant { color: #a8660d; } +pre .escape { color: #844631; } +pre .keyword { color: #aa5050; font-weight: bold; } +pre .library { color: #0e7c6b; } +pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } +pre .string { color: #8080ff; } +pre .number { color: #f8660d; } +pre .operator { color: #2239a8; font-weight: bold; } +pre .preprocessor, pre .prepro { color: #a33243; } +pre .global { color: #800080; } +pre .user-keyword { color: #800080; } +pre .prompt { color: #558817; } +pre .url { color: #272fc2; text-decoration: underline; } + diff --git a/doc/doc/luadoc.css b/doc/doc/luadoc.css deleted file mode 100644 index bc0f98a..0000000 --- a/doc/doc/luadoc.css +++ /dev/null @@ -1,286 +0,0 @@ -body { - margin-left: 1em; - margin-right: 1em; - font-family: arial, helvetica, geneva, sans-serif; - background-color:#ffffff; margin:0px; -} - -code { - font-family: "Andale Mono", monospace; -} - -tt { - font-family: "Andale Mono", monospace; -} - -body, td, th { font-size: 11pt; } - -h1, h2, h3, h4 { margin-left: 0em; } - -textarea, pre, tt { font-size:10pt; } -body, td, th { color:#000000; } -small { font-size:0.85em; } -h1 { font-size:1.5em; } -h2 { font-size:1.25em; } -h3 { font-size:1.15em; } -h4 { font-size:1.06em; } - -a:link { font-weight:bold; color: #004080; text-decoration: none; } -a:visited { font-weight:bold; color: #006699; text-decoration: none; } -a:link:hover { text-decoration:underline; } -hr { color:#cccccc } -img { border-width: 0px; } - - -h3 { padding-top: 1em; } - -p { margin-left: 1em; } - -p.name { - font-family: "Andale Mono", monospace; - padding-top: 1em; - margin-left: 0em; -} - -blockquote { margin-left: 3em; } - -pre.example { - background-color: rgb(245, 245, 245); - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: silver; - border-right-color: silver; - border-bottom-color: silver; - border-left-color: silver; - padding: 1em; - margin-left: 1em; - margin-right: 1em; - font-family: "Andale Mono", monospace; - font-size: smaller; -} - - -hr { - margin-left: 0em; - background: #00007f; - border: 0px; - height: 1px; -} - -ul { list-style-type: disc; } - -table.index { border: 1px #00007f; } -table.index td { text-align: left; vertical-align: top; } -table.index ul { padding-top: 0em; margin-top: 0em; } - -table { - border: 1px solid black; - border-collapse: collapse; - margin-left: auto; - margin-right: auto; -} -th { - border: 1px solid black; - padding: 0.5em; -} -td { - border: 1px solid black; - padding: 0.5em; -} -div.header, div.footer { margin-left: 0em; } - -#container -{ - margin-left: 1em; - margin-right: 1em; - background-color: #f0f0f0; -} - -#product -{ - text-align: center; - border-bottom: 1px solid #cccccc; - background-color: #ffffff; -} - -#product big { - font-size: 2em; -} - -#product_logo -{ -} - -#product_name -{ -} - -#product_description -{ -} - -#main -{ - background-color: #f0f0f0; - border-left: 2px solid #cccccc; -} - -#navigation -{ - float: left; - width: 18em; - margin: 0; - vertical-align: top; - background-color: #f0f0f0; - overflow:visible; -} - -#navigation h1 { - background-color:#e7e7e7; - font-size:1.1em; - color:#000000; - text-align:left; - margin:0px; - padding:0.2em; - border-top:1px solid #dddddd; - border-bottom:1px solid #dddddd; -} - -#navigation ul -{ - font-size:1em; - list-style-type: none; - padding: 0; - margin: 1px; -} - -#navigation li -{ - text-indent: -1em; - margin: 0em 0em 0em 0.5em; - display: block; - padding: 3px 0px 0px 12px; -} - -#navigation li li a -{ - padding: 0px 3px 0px -1em; -} - -#content -{ - margin-left: 18em; - padding: 1em; - border-left: 2px solid #cccccc; - border-right: 2px solid #cccccc; - background-color: #ffffff; -} - -#about -{ - clear: both; - margin: 0; - padding: 5px; - border-top: 2px solid #cccccc; - background-color: #ffffff; -} - -@media print { - body { - font: 12pt "Times New Roman", "TimeNR", Times, serif; - } - a { font-weight:bold; color: #004080; text-decoration: underline; } - - #main
{
background-color: #ffffff;
border-left: 0px;
}
- #container
{
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
} - - #content
{
margin-left: 0px;
padding: 1em;
border-left: 0px;
border-right: 0px;
background-color: #ffffff;
} - - #navigation
{
display: none; - } - pre.example { - font-family: "Andale Mono", monospace; - font-size: 10pt; - page-break-inside: avoid; - } -} - -table.module_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.module_list td.name { background-color: #f0f0f0; } -table.module_list td.summary { width: 100%; } - -table.file_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.file_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.file_list td.name { background-color: #f0f0f0; } -table.file_list td.summary { width: 100%; } - - -table.function_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.function_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.function_list td.name { background-color: #f0f0f0; } -table.function_list td.summary { width: 100%; } - - -table.table_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.table_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.table_list td.name { background-color: #f0f0f0; } -table.table_list td.summary { width: 100%; } - -dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.function dd {padding-bottom: 1em;} -dl.function h3 {padding: 0; margin: 0; font-size: medium;} - -dl.table dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.table dd {padding-bottom: 1em;} -dl.table h3 {padding: 0; margin: 0; font-size: medium;} - -#TODO: make module_list, file_list, function_list, table_list inherit from a list - diff --git a/doc/doc/modules/luacov.defaults.html b/doc/doc/modules/luacov.defaults.html new file mode 100644 index 0000000..9427e67 --- /dev/null +++ b/doc/doc/modules/luacov.defaults.html @@ -0,0 +1,279 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>LuaCov Reference</title> + <link rel="stylesheet" href="../ldoc.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<br/> +<h1>LuaCov</h1> + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Tables">Tables</a></li> +<li><a href="#Fields">Fields</a></li> +</ul> + + +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/luacov.html">luacov</a></li> + <li><strong>luacov.defaults</strong></li> + <li><a href="../modules/luacov.reporter.html">luacov.reporter</a></li> + <li><a href="../modules/luacov.runner.html">luacov.runner</a></li> + <li><a href="../modules/luacov.stats.html">luacov.stats</a></li> + <li><a href="../modules/luacov.tick.html">luacov.tick</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Module <code>luacov.defaults</code></h1> +<p>Default configuration file.</p> +<p> Copy, customize and store in your + project folder as '.luacov' for project specific configuration. + If some options are missing, their default values from this file + will be used.</p> + + +<h2><a href="#Tables">Tables</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#include">include</a></td> + <td class="summary">Patterns for files to include when reporting.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#exclude">exclude</a></td> + <td class="summary">Patterns for files to exclude when reporting.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#modules">modules</a></td> + <td class="summary">Table mapping names of modules to be included to their filenames.</td> + </tr> +</table> +<h2><a href="#Fields">Fields</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#statsfile">statsfile</a></td> + <td class="summary">Filename to store collected stats.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#reportfile">reportfile</a></td> + <td class="summary">Filename to store report.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#savestepsize">savestepsize</a></td> + <td class="summary">Stats file updating frequency for <a href="../modules/luacov.tick.html#">luacov.tick</a>.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#runreport">runreport</a></td> + <td class="summary">Run reporter on completion?</td> + </tr> + <tr> + <td class="name" nowrap><a href="#deletestats">deletestats</a></td> + <td class="summary">Delete stats file after reporting?</td> + </tr> + <tr> + <td class="name" nowrap><a href="#codefromstrings">codefromstrings</a></td> + <td class="summary">Process Lua code loaded from raw strings?</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Tables"></a>Tables</h2> + + <dl class="function"> + <dt> + <a name = "include"></a> + <strong>include</strong> + </dt> + <dd> + Patterns for files to include when reporting. + All will be included if nothing is listed. + Do not include the '.lua' extension. Path separator is always '/'. + Overruled by <a href="../modules/luacov.defaults.html#exclude">exclude</a>. + + + + + + + +</dd> + <dt> + <a name = "exclude"></a> + <strong>exclude</strong> + </dt> + <dd> + Patterns for files to exclude when reporting. + Nothing will be excluded if nothing is listed. + Do not include the '.lua' extension. Path separator is always '/'. + Overrules <a href="../modules/luacov.defaults.html#include">include</a>. + + + + + + + +</dd> + <dt> + <a name = "modules"></a> + <strong>modules</strong> + </dt> + <dd> + Table mapping names of modules to be included to their filenames. + Has no effect if empty. + Real filenames mentioned here will be used for reporting + even if the modules have been installed elsewhere. + Module name can contain '*' wildcard to match groups of modules, + in this case corresponding path will be used as a prefix directory + where modules from the group are located. + + + + + + + <h3>Usage:</h3> + <ul> + <pre class="example"> + modules = { + [<span class="string">"some_rock"</span>] = <span class="string">"src/some_rock.lua"</span>, + [<span class="string">"some_rock.*"</span>] = <span class="string">"src"</span> + }</pre> + </ul> + +</dd> +</dl> + <h2 class="section-header "><a name="Fields"></a>Fields</h2> + + <dl class="function"> + <dt> + <a name = "statsfile"></a> + <strong>statsfile</strong> + </dt> + <dd> + Filename to store collected stats. Default: "luacov.stats.out". + + + + + + + +</dd> + <dt> + <a name = "reportfile"></a> + <strong>reportfile</strong> + </dt> + <dd> + Filename to store report. Default: "luacov.report.out". + + + + + + + +</dd> + <dt> + <a name = "savestepsize"></a> + <strong>savestepsize</strong> + </dt> + <dd> + Stats file updating frequency for <a href="../modules/luacov.tick.html#">luacov.tick</a>. + The lower this value - the more frequently results will be written out to the stats file. + You may want to reduce this value (to, for example, 2) to avoid losing coverage data in + case your program may terminate without triggering luacov exit hooks that are supposed + to save the data. Default: 100. + + + + + + + +</dd> + <dt> + <a name = "runreport"></a> + <strong>runreport</strong> + </dt> + <dd> + Run reporter on completion? Default: false. + + + + + + + +</dd> + <dt> + <a name = "deletestats"></a> + <strong>deletestats</strong> + </dt> + <dd> + Delete stats file after reporting? Default: false. + + + + + + + +</dd> + <dt> + <a name = "codefromstrings"></a> + <strong>codefromstrings</strong> + </dt> + <dd> + Process Lua code loaded from raw strings? + That is, when the 'source' field in the debug info + does not start with '@'. Default: false. + + + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> +<i style="float:right;">Last updated 2015-11-16 21:06:14 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/doc/modules/luacov.html b/doc/doc/modules/luacov.html new file mode 100644 index 0000000..63bd075 --- /dev/null +++ b/doc/doc/modules/luacov.html @@ -0,0 +1,73 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>LuaCov Reference</title> + <link rel="stylesheet" href="../ldoc.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<br/> +<h1>LuaCov</h1> + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + + + +<h2>Modules</h2> +<ul class="nowrap"> + <li><strong>luacov</strong></li> + <li><a href="../modules/luacov.defaults.html">luacov.defaults</a></li> + <li><a href="../modules/luacov.reporter.html">luacov.reporter</a></li> + <li><a href="../modules/luacov.runner.html">luacov.runner</a></li> + <li><a href="../modules/luacov.stats.html">luacov.stats</a></li> + <li><a href="../modules/luacov.tick.html">luacov.tick</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Module <code>luacov</code></h1> +<p>Loads <a href="../modules/luacov.runner.html#">luacov.runner</a> and immediately starts it.</p> +<p> Useful for launching scripts from the command-line. Returns the <a href="../modules/luacov.runner.html#">luacov.runner</a> module.</p> + <h3>Usage:</h3> + <ul> + <pre class="example">lua -lluacov sometest.lua</pre> + </ul> + + + +<br/> +<br/> + + + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> +<i style="float:right;">Last updated 2015-11-16 21:06:14 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/doc/modules/luacov.reporter.html b/doc/doc/modules/luacov.reporter.html new file mode 100644 index 0000000..06dc727 --- /dev/null +++ b/doc/doc/modules/luacov.reporter.html @@ -0,0 +1,430 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>LuaCov Reference</title> + <link rel="stylesheet" href="../ldoc.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<br/> +<h1>LuaCov</h1> + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +<li><a href="#Class_ReporterBase">Class ReporterBase </a></li> +</ul> + + +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/luacov.html">luacov</a></li> + <li><a href="../modules/luacov.defaults.html">luacov.defaults</a></li> + <li><strong>luacov.reporter</strong></li> + <li><a href="../modules/luacov.runner.html">luacov.runner</a></li> + <li><a href="../modules/luacov.stats.html">luacov.stats</a></li> + <li><a href="../modules/luacov.tick.html">luacov.tick</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Module <code>luacov.reporter</code></h1> +<p>Report module, will transform statistics file into a report.</p> +<p> + +</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#report">report ([reporter_class])</a></td> + <td class="summary">Runs the report generator.</td> + </tr> +</table> +<h2><a href="#Class_ReporterBase">Class ReporterBase </a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#ReporterBase:config">ReporterBase:config ()</a></td> + <td class="summary">Returns configuration table.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:max_hits">ReporterBase:max_hits ()</a></td> + <td class="summary">Returns maximum number of hits per line in all coverage data.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:write">ReporterBase:write (...)</a></td> + <td class="summary">Writes strings to report file.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:files">ReporterBase:files ()</a></td> + <td class="summary">Returns array of filenames to be reported.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:stats">ReporterBase:stats (filename)</a></td> + <td class="summary">Returns coverage data for a file.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:on_start">ReporterBase:on_start ()</a></td> + <td class="summary">Stub method called before reporting.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:on_new_file">ReporterBase:on_new_file (filename)</a></td> + <td class="summary">Stub method called before processing a file.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:on_empty_line">ReporterBase:on_empty_line (filename, lineno, line)</a></td> + <td class="summary">Stub method called for each empty source line + and other lines that can't be hit.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:on_mis_line">ReporterBase:on_mis_line (filename, lineno, line)</a></td> + <td class="summary">Stub method called for each missed source line.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:on_hit_line">ReporterBase:on_hit_line (filename, lineno, line, hits)</a></td> + <td class="summary">Stub method called for each hit source line.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:on_end_file">ReporterBase:on_end_file (filename, hits, miss)</a></td> + <td class="summary">Stub method called after a file has been processed.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#ReporterBase:on_end">ReporterBase:on_end ()</a></td> + <td class="summary">Stub method called after reporting.</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + + <dl class="function"> + <dt> + <a name = "report"></a> + <strong>report ([reporter_class])</strong> + </dt> + <dd> + Runs the report generator. + To load a config, use <a href="../modules/luacov.runner.html#load_config">luacov.runner.load_config</a> first. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">reporter_class</span> + custom reporter class. Will be + instantiated using 'new' method with configuration + (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>) as the argument. It should + return nil + error if something went wrong. + After acquiring a reporter object its 'run' and 'close' + methods will be called. + The easiest way to implement a custom reporter class is to + extend <a href="../modules/luacov.reporter.html#ReporterBase">ReporterBase</a>. + (<em>optional</em>) + </li> + </ul> + + + + + +</dd> +</dl> + <h2 class="section-header has-description"><a name="Class_ReporterBase"></a>Class ReporterBase </h2> + + <div class="section-description"> + Basic reporter class stub. + Implements 'new', 'run' and 'close' methods required by <a href="../modules/luacov.reporter.html#report">report</a>. + Provides some helper methods and stubs to be overridden by child classes. + </div> + <h3>Usage:</h3> + <pre class="example"> + <span class="keyword">local</span> MyReporter = <span class="global">setmetatable</span>({}, ReporterBase) + MyReporter.__index = MyReporter + <span class="keyword">function</span> MyReporter:on_hit_line(...) + self:write((<span class="string">"File %s: hit line %s %d times"</span>):format(...)) + <span class="keyword">end</span></pre> + <dl class="function"> + <dt> + <a name = "ReporterBase:config"></a> + <strong>ReporterBase:config ()</strong> + </dt> + <dd> + Returns configuration table. + + + + + + <h3>See also:</h3> + <ul> + <a href="../modules/luacov.defaults.html#">luacov.defaults</a> + </ul> + + +</dd> + <dt> + <a name = "ReporterBase:max_hits"></a> + <strong>ReporterBase:max_hits ()</strong> + </dt> + <dd> + Returns maximum number of hits per line in all coverage data. + + + + + + + +</dd> + <dt> + <a name = "ReporterBase:write"></a> + <strong>ReporterBase:write (...)</strong> + </dt> + <dd> + Writes strings to report file. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">...</span> + strings. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "ReporterBase:files"></a> + <strong>ReporterBase:files ()</strong> + </dt> + <dd> + Returns array of filenames to be reported. + + + + + + + +</dd> + <dt> + <a name = "ReporterBase:stats"></a> + <strong>ReporterBase:stats (filename)</strong> + </dt> + <dd> + Returns coverage data for a file. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + name of the file. + </li> + </ul> + + + + <h3>See also:</h3> + <ul> + <a href="../modules/luacov.stats.html#load">luacov.stats.load</a> + </ul> + + +</dd> + <dt> + <a name = "ReporterBase:on_start"></a> + <strong>ReporterBase:on_start ()</strong> + </dt> + <dd> + Stub method called before reporting. + + + + + + + +</dd> + <dt> + <a name = "ReporterBase:on_new_file"></a> + <strong>ReporterBase:on_new_file (filename)</strong> + </dt> + <dd> + Stub method called before processing a file. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + name of the file. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "ReporterBase:on_empty_line"></a> + <strong>ReporterBase:on_empty_line (filename, lineno, line)</strong> + </dt> + <dd> + Stub method called for each empty source line + and other lines that can't be hit. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + name of the file. + </li> + <li><span class="parameter">lineno</span> + line number. + </li> + <li><span class="parameter">line</span> + the line itself as a string. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "ReporterBase:on_mis_line"></a> + <strong>ReporterBase:on_mis_line (filename, lineno, line)</strong> + </dt> + <dd> + Stub method called for each missed source line. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + name of the file. + </li> + <li><span class="parameter">lineno</span> + line number. + </li> + <li><span class="parameter">line</span> + the line itself as a string. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "ReporterBase:on_hit_line"></a> + <strong>ReporterBase:on_hit_line (filename, lineno, line, hits)</strong> + </dt> + <dd> + Stub method called for each hit source line. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + name of the file. + </li> + <li><span class="parameter">lineno</span> + line number. + </li> + <li><span class="parameter">line</span> + the line itself as a string. + </li> + <li><span class="parameter">hits</span> + number of times the line was hit. Should be positive. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "ReporterBase:on_end_file"></a> + <strong>ReporterBase:on_end_file (filename, hits, miss)</strong> + </dt> + <dd> + Stub method called after a file has been processed. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + name of the file. + </li> + <li><span class="parameter">hits</span> + total number of hit lines in the file. + </li> + <li><span class="parameter">miss</span> + total number of missed lines in the file. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "ReporterBase:on_end"></a> + <strong>ReporterBase:on_end ()</strong> + </dt> + <dd> + Stub method called after reporting. + + + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> +<i style="float:right;">Last updated 2015-11-16 21:06:14 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/doc/modules/luacov.runner.html b/doc/doc/modules/luacov.runner.html new file mode 100644 index 0000000..8aab603 --- /dev/null +++ b/doc/doc/modules/luacov.runner.html @@ -0,0 +1,454 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>LuaCov Reference</title> + <link rel="stylesheet" href="../ldoc.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<br/> +<h1>LuaCov</h1> + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +</ul> + + +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/luacov.html">luacov</a></li> + <li><a href="../modules/luacov.defaults.html">luacov.defaults</a></li> + <li><a href="../modules/luacov.reporter.html">luacov.reporter</a></li> + <li><strong>luacov.runner</strong></li> + <li><a href="../modules/luacov.stats.html">luacov.stats</a></li> + <li><a href="../modules/luacov.tick.html">luacov.tick</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Module <code>luacov.runner</code></h1> +<p>Statistics collecting module.</p> +<p> Calling the module table is a shortcut to calling the <a href="../modules/luacov.runner.html#init">init</a> function.</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#file_included">file_included (filename)</a></td> + <td class="summary">Uses LuaCov's configuration to check if a file is included for + coverage data collection.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#update_stats">update_stats (old_stats, extra_stats)</a></td> + <td class="summary">Adds stats to an existing file stats table.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#run_report">run_report ([configuration])</a></td> + <td class="summary">Runs the reporter specified in configuration.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#real_name">real_name (filename)</a></td> + <td class="summary">Returns real name for a source file name + using <a href="../modules/luacov.defaults.html#modules">luacov.defaults.modules</a> option.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#load_config">load_config ([configuration])</a></td> + <td class="summary">Loads a valid configuration.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#pause">pause ()</a></td> + <td class="summary">Pauses LuaCov's runner.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#resume">resume ()</a></td> + <td class="summary">Resumes LuaCov's runner.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#init">init ([configuration])</a></td> + <td class="summary">Initializes LuaCov runner to start collecting data.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#shutdown">shutdown ()</a></td> + <td class="summary">Shuts down LuaCov's runner.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#excludefile">excludefile (name)</a></td> + <td class="summary">Adds a file to the exclude list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>).</td> + </tr> + <tr> + <td class="name" nowrap><a href="#includefile">includefile (name)</a></td> + <td class="summary">Adds a file to the include list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>).</td> + </tr> + <tr> + <td class="name" nowrap><a href="#excludetree">excludetree (name, level)</a></td> + <td class="summary">Adds a tree to the exclude list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>).</td> + </tr> + <tr> + <td class="name" nowrap><a href="#includetree">includetree (name, level)</a></td> + <td class="summary">Adds a tree to the include list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>).</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + + <dl class="function"> + <dt> + <a name = "file_included"></a> + <strong>file_included (filename)</strong> + </dt> + <dd> + Uses LuaCov's configuration to check if a file is included for + coverage data collection. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + Normalize file names before using patterns. + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + true if file is included, false otherwise. + </ol> + + + + +</dd> + <dt> + <a name = "update_stats"></a> + <strong>update_stats (old_stats, extra_stats)</strong> + </dt> + <dd> + Adds stats to an existing file stats table. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">old_stats</span> + stats to be updated. + </li> + <li><span class="parameter">extra_stats</span> + another stats table, will be broken during update. + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "run_report"></a> + <strong>run_report ([configuration])</strong> + </dt> + <dd> + Runs the reporter specified in configuration. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">configuration</span> + if string, filename of config file (used to call <a href="../modules/luacov.runner.html#load_config">load_config</a>). + If table then config table (see file <code>luacov.default.lua</code> for an example). + If <code>configuration.reporter</code> is not set, runs the default reporter; + otherwise, it must be a module name in 'luacov.reporter' namespace. + The module must contain 'report' function, which is called without arguments. + (<em>optional</em>) + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "real_name"></a> + <strong>real_name (filename)</strong> + </dt> + <dd> + Returns real name for a source file name + using <a href="../modules/luacov.defaults.html#modules">luacov.defaults.modules</a> option. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">filename</span> + + + + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "load_config"></a> + <strong>load_config ([configuration])</strong> + </dt> + <dd> + Loads a valid configuration. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">configuration</span> + user provided config (config-table or filename) + (<em>optional</em>) + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + existing configuration if already set, otherwise loads a new + config from the provided data or the defaults. + When loading a new config, if some options are missing, default values + from <a href="../modules/luacov.defaults.html#">luacov.defaults</a> are used instead. + </ol> + + + + +</dd> + <dt> + <a name = "pause"></a> + <strong>pause ()</strong> + </dt> + <dd> + Pauses LuaCov's runner. + Saves collected data and stops, allowing other processes to write to + the same stats file. Data is still collected during pause. + + + + + + + +</dd> + <dt> + <a name = "resume"></a> + <strong>resume ()</strong> + </dt> + <dd> + Resumes LuaCov's runner. + Reloads stats file, possibly updated from other processes, + and continues saving collected data. + + + + + + + +</dd> + <dt> + <a name = "init"></a> + <strong>init ([configuration])</strong> + </dt> + <dd> + Initializes LuaCov runner to start collecting data. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">configuration</span> + if string, filename of config file (used to call <a href="../modules/luacov.runner.html#load_config">load_config</a>). + If table then config table (see file <code>luacov.default.lua</code> for an example) + (<em>optional</em>) + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "shutdown"></a> + <strong>shutdown ()</strong> + </dt> + <dd> + Shuts down LuaCov's runner. + This should only be called from daemon processes or sandboxes which have + disabled os.exit and other hooks that are used to determine shutdown. + + + + + + + +</dd> + <dt> + <a name = "excludefile"></a> + <strong>excludefile (name)</strong> + </dt> + <dd> + Adds a file to the exclude list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>). + If passed a function, then through debuginfo the source filename is collected. In case of a table + it will recursively search the table for a function, which is then resolved to a filename through debuginfo. + If the parameter is a string, it will first check if a file by that name exists. If it doesn't exist + it will call <code>require(name)</code> to load a module by that name, and the result of require (function or + table expected) is used as described above to get the sourcefile. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">name</span> + + +<ul> + <li>string; literal filename,</li> + <li>string; modulename as passed to require(),</li> + <li>function; where containing file is looked up,</li> + <li>table; module table where containing file is looked up</li> +</ul> + + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + the pattern as added to the list, or nil + error + </ol> + + + + +</dd> + <dt> + <a name = "includefile"></a> + <strong>includefile (name)</strong> + </dt> + <dd> + Adds a file to the include list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>). + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">name</span> + see <a href="../modules/luacov.runner.html#excludefile">excludefile</a> + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + the pattern as added to the list, or nil + error + </ol> + + + + +</dd> + <dt> + <a name = "excludetree"></a> + <strong>excludetree (name, level)</strong> + </dt> + <dd> + Adds a tree to the exclude list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>). + If <code>name = 'luacov'</code> and <code>level = nil</code> then + module 'luacov' (luacov.lua) and the tree 'luacov' (containing <code>luacov/runner.lua</code> etc.) is excluded. + If <code>name = 'pl.path'</code> and <code>level = true</code> then + module 'pl' (pl.lua) and the tree 'pl' (containing <code>pl/path.lua</code> etc.) is excluded. + NOTE: in case of an 'init.lua' file, the 'level' parameter will always be set + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">name</span> + see <a href="../modules/luacov.runner.html#excludefile">excludefile</a> + </li> + <li><span class="parameter">level</span> + if truthy then one level up is added, including the tree + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + the 2 patterns as added to the list (file and tree), or nil + error + </ol> + + + + +</dd> + <dt> + <a name = "includetree"></a> + <strong>includetree (name, level)</strong> + </dt> + <dd> + Adds a tree to the include list (see <a href="../modules/luacov.defaults.html#">luacov.defaults</a>). + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">name</span> + see <a href="../modules/luacov.runner.html#excludefile">excludefile</a> + </li> + <li><span class="parameter">level</span> + see <a href="../modules/luacov.runner.html#includetree">includetree</a> + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + the 2 patterns as added to the list (file and tree), or nil + error + </ol> + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> +<i style="float:right;">Last updated 2015-11-16 21:06:14 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/doc/modules/luacov.stats.html b/doc/doc/modules/luacov.stats.html new file mode 100644 index 0000000..6702a76 --- /dev/null +++ b/doc/doc/modules/luacov.stats.html @@ -0,0 +1,181 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>LuaCov Reference</title> + <link rel="stylesheet" href="../ldoc.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<br/> +<h1>LuaCov</h1> + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + +<h2>Contents</h2> +<ul> +<li><a href="#Functions">Functions</a></li> +</ul> + + +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/luacov.html">luacov</a></li> + <li><a href="../modules/luacov.defaults.html">luacov.defaults</a></li> + <li><a href="../modules/luacov.reporter.html">luacov.reporter</a></li> + <li><a href="../modules/luacov.runner.html">luacov.runner</a></li> + <li><strong>luacov.stats</strong></li> + <li><a href="../modules/luacov.tick.html">luacov.tick</a></li> +</ul> + +</div> + +<div id="content"> + +<h1>Module <code>luacov.stats</code></h1> +<p>Manages the file with statistics (being) collected.</p> +<p> In general the module requires that its property <code>stats.statsfile</code> + has been set to the filename of the statsfile to create, load, etc.</p> + + +<h2><a href="#Functions">Functions</a></h2> +<table class="function_list"> + <tr> + <td class="name" nowrap><a href="#load">load ()</a></td> + <td class="summary">Loads the stats file.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#start">start ()</a></td> + <td class="summary">Opens the statfile</td> + </tr> + <tr> + <td class="name" nowrap><a href="#stop">stop (fd)</a></td> + <td class="summary">Closes the statfile</td> + </tr> + <tr> + <td class="name" nowrap><a href="#save">save (data, fd)</a></td> + <td class="summary">Saves data to the statfile</td> + </tr> +</table> + +<br/> +<br/> + + + <h2 class="section-header "><a name="Functions"></a>Functions</h2> + + <dl class="function"> + <dt> + <a name = "load"></a> + <strong>load ()</strong> + </dt> + <dd> + Loads the stats file. + + + + <h3>Returns:</h3> + <ol> + + table with data. The table maps filenames to stats tables. + Per-file tables map line numbers to hits or nils when there are no hits. + Additionally, .max field contains maximum line number + and .max_hits contains maximum number of hits in the file. + </ol> + + + + +</dd> + <dt> + <a name = "start"></a> + <strong>start ()</strong> + </dt> + <dd> + Opens the statfile + + + + <h3>Returns:</h3> + <ol> + + filehandle + </ol> + + + + +</dd> + <dt> + <a name = "stop"></a> + <strong>stop (fd)</strong> + </dt> + <dd> + Closes the statfile + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">fd</span> + filehandle to the statsfile + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "save"></a> + <strong>save (data, fd)</strong> + </dt> + <dd> + Saves data to the statfile + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">data</span> + data to store + </li> + <li><span class="parameter">fd</span> + filehandle where to store + </li> + </ul> + + + + + +</dd> +</dl> + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> +<i style="float:right;">Last updated 2015-11-16 21:06:14 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/doc/doc/modules/luacov.tick.html b/doc/doc/modules/luacov.tick.html new file mode 100644 index 0000000..7250605 --- /dev/null +++ b/doc/doc/modules/luacov.tick.html @@ -0,0 +1,75 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<head> + <title>LuaCov Reference</title> + <link rel="stylesheet" href="../ldoc.css" type="text/css" /> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + + +<div id="main"> + + +<!-- Menu --> + +<div id="navigation"> +<br/> +<h1>LuaCov</h1> + +<ul> + <li><a href="../index.html">Index</a></li> +</ul> + + + +<h2>Modules</h2> +<ul class="nowrap"> + <li><a href="../modules/luacov.html">luacov</a></li> + <li><a href="../modules/luacov.defaults.html">luacov.defaults</a></li> + <li><a href="../modules/luacov.reporter.html">luacov.reporter</a></li> + <li><a href="../modules/luacov.runner.html">luacov.runner</a></li> + <li><a href="../modules/luacov.stats.html">luacov.stats</a></li> + <li><strong>luacov.tick</strong></li> +</ul> + +</div> + +<div id="content"> + +<h1>Module <code>luacov.tick</code></h1> +<p>Load luacov using this if you want it to periodically + save the stats file.</p> +<p> This is useful if your script is + a daemon (i.e., does not properly terminate).</p> + <h3>See also:</h3> + <ul> + <a href="../modules/luacov.defaults.html#savestepsize">luacov.defaults.savestepsize</a> + </ul> + + + +<br/> +<br/> + + + + +</div> <!-- id="content" --> +</div> <!-- id="main" --> +<div id="about"> +<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> +<i style="float:right;">Last updated 2015-11-16 21:06:14 </i> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> diff --git a/src/luacov.lua b/src/luacov.lua index 1237e8e..8c8ce45 100644 --- a/src/luacov.lua +++ b/src/luacov.lua @@ -1,8 +1,8 @@ ---- Loads <code>luacov.runner</code> and immediately starts it. --- Useful for launching scripts from the command-line. Returns the <code>luacov.runner</code> module. +--- Loads `luacov.runner` and immediately starts it. +-- Useful for launching scripts from the command-line. Returns the `luacov.runner` module. -- @class module -- @name luacov --- @example lua -lluacov sometest.lua +-- @usage lua -lluacov sometest.lua local runner = require("luacov.runner") runner.init() -return runner
\ No newline at end of file +return runner diff --git a/src/luacov/defaults.lua b/src/luacov/defaults.lua index e13a032..89ab063 100644 --- a/src/luacov/defaults.lua +++ b/src/luacov/defaults.lua @@ -1,4 +1,4 @@ ---- Global configuration file. Copy, customize and store in your +--- Default configuration file. Copy, customize and store in your -- project folder as '.luacov' for project specific configuration. -- If some options are missing, their default values from this file -- will be used. @@ -6,55 +6,54 @@ -- @name luacov.defaults return { - -- filename to store stats collected - ["statsfile"] = "luacov.stats.out", + --- Filename to store collected stats. Default: "luacov.stats.out". + statsfile = "luacov.stats.out", - -- filename to store report - ["reportfile"] = "luacov.report.out", + --- Filename to store report. Default: "luacov.report.out". + reportfile = "luacov.report.out", - -- luacov.stats file updating frequency. - -- The lower this value - the more frequently results will be written out to luacov.stats - -- You may want to reduce this value for short lived scripts (to for example 2) to avoid losing coverage data. - ["savestepsize"] = 100, + --- Stats file updating frequency for `luacov.tick`. + -- The lower this value - the more frequently results will be written out to the stats file. + -- You may want to reduce this value (to, for example, 2) to avoid losing coverage data in + -- case your program may terminate without triggering luacov exit hooks that are supposed + -- to save the data. Default: 100. + savestepsize = 100, - -- Run reporter on completion? (won't work for ticks) + --- Run reporter on completion? Default: false. runreport = false, - -- Delete stats file after reporting? + --- Delete stats file after reporting? Default: false. deletestats = false, - -- Process Lua code loaded from raw strings - -- (that is, when the 'source' field in the debug info - -- does not start with '@') + --- Process Lua code loaded from raw strings? + -- That is, when the 'source' field in the debug info + -- does not start with '@'. Default: false. codefromstrings = false, - -- Patterns for files to include when reporting - -- all will be included if nothing is listed - -- (exclude overrules include, do not include - -- the .lua extension, path separator is always '/') - ["include"] = { - }, - - -- Patterns for files to exclude when reporting - -- all will be included if nothing is listed - -- (exclude overrules include, do not include - -- the .lua extension, path separator is always '/') - ["exclude"] = { - }, - - -- Table mapping names of modules to be included to their filenames. + --- Patterns for files to include when reporting. + -- All will be included if nothing is listed. + -- Do not include the '.lua' extension. Path separator is always '/'. + -- Overruled by `exclude`. + include = {}, + + --- Patterns for files to exclude when reporting. + -- Nothing will be excluded if nothing is listed. + -- Do not include the '.lua' extension. Path separator is always '/'. + -- Overrules `include`. + exclude = {}, + + --- Table mapping names of modules to be included to their filenames. -- Has no effect if empty. -- Real filenames mentioned here will be used for reporting -- even if the modules have been installed elsewhere. -- Module name can contain '*' wildcard to match groups of modules, -- in this case corresponding path will be used as a prefix directory -- where modules from the group are located. - -- Example: + -- @usage -- modules = { - -- ["some_rock"] = "src/some_rock.lua", - -- ["some_rock.*"] = "src" + -- ["some_rock"] = "src/some_rock.lua", + -- ["some_rock.*"] = "src" -- } - modules = { - }, + modules = {}, } diff --git a/src/luacov/reporter.lua b/src/luacov/reporter.lua index 76c58c6..20a2372 100644 --- a/src/luacov/reporter.lua +++ b/src/luacov/reporter.lua @@ -292,6 +292,16 @@ end end ---------------------------------------------------------------- +--- Basic reporter class stub. +-- Implements 'new', 'run' and 'close' methods required by `report`. +-- Provides some helper methods and stubs to be overridden by child classes. +-- @usage +-- local MyReporter = setmetatable({}, ReporterBase) +-- MyReporter.__index = MyReporter +-- function MyReporter:on_hit_line(...) +-- self:write(("File %s: hit line %s %d times"):format(...)) +-- end +-- @type ReporterBase local ReporterBase = {} do ReporterBase.__index = ReporterBase @@ -342,14 +352,19 @@ function ReporterBase:new(conf) return o end +--- Returns configuration table. +-- @see luacov.defaults function ReporterBase:config() return self._cfg end +--- Returns maximum number of hits per line in all coverage data. function ReporterBase:max_hits() return self._mhit end +--- Writes strings to report file. +-- @param ... strings. function ReporterBase:write(...) return self._out:write(...) end @@ -359,32 +374,58 @@ function ReporterBase:close() self._private = nil end +--- Returns array of filenames to be reported. function ReporterBase:files() return self._files end +--- Returns coverage data for a file. +-- @param filename name of the file. +-- @see luacov.stats.load function ReporterBase:stats(filename) return self._data[filename] end +--- Stub method called before reporting. function ReporterBase:on_start() end +--- Stub method called before processing a file. +-- @param filename name of the file. function ReporterBase:on_new_file(filename) end +--- Stub method called for each empty source line +-- and other lines that can't be hit. +-- @param filename name of the file. +-- @param lineno line number. +-- @param line the line itself as a string. function ReporterBase:on_empty_line(filename, lineno, line) end +--- Stub method called for each missed source line. +-- @param filename name of the file. +-- @param lineno line number. +-- @param line the line itself as a string. function ReporterBase:on_mis_line(filename, lineno, line) end +--- Stub method called for each hit source line. +-- @param filename name of the file. +-- @param lineno line number. +-- @param line the line itself as a string. +-- @param hits number of times the line was hit. Should be positive. function ReporterBase:on_hit_line(filename, lineno, line, hits) end +--- Stub method called after a file has been processed. +-- @param filename name of the file. +-- @param hits total number of hit lines in the file. +-- @param miss total number of missed lines in the file. function ReporterBase:on_end_file(filename, hits, miss) end +--- Stub method called after reporting. function ReporterBase:on_end() end @@ -432,6 +473,7 @@ function ReporterBase:run() end end +--- @section end ---------------------------------------------------------------- ---------------------------------------------------------------- @@ -501,6 +543,16 @@ end end ---------------------------------------------------------------- +--- Runs the report generator. +-- To load a config, use `luacov.runner.load_config` first. +-- @param[opt] reporter_class custom reporter class. Will be +-- instantiated using 'new' method with configuration +-- (see `luacov.defaults`) as the argument. It should +-- return nil + error if something went wrong. +-- After acquiring a reporter object its 'run' and 'close' +-- methods will be called. +-- The easiest way to implement a custom reporter class is to +-- extend `ReporterBase`. function reporter.report(reporter_class) local configuration = luacov.load_config() diff --git a/src/luacov/runner.lua b/src/luacov/runner.lua index 42dac1f..150acd3 100644 --- a/src/luacov/runner.lua +++ b/src/luacov/runner.lua @@ -1,6 +1,6 @@ --------------------------------------------------- -- Statistics collecting module. --- Calling the module table is a shortcut to calling the <code>init()</code> method. +-- Calling the module table is a shortcut to calling the `init` function. -- @class module -- @name luacov.runner @@ -122,9 +122,9 @@ end ------------------------------------------------------ -- Runs the reporter specified in configuration. --- @param configuration if string, filename of config file (used to call <code>load_config</code>). --- If table then config table (see file <code>luacov.default.lua</code> for an example). --- If <code>configuration.reporter</code> is not set, runs the default reporter; +-- @param[opt] configuration if string, filename of config file (used to call `load_config`). +-- If table then config table (see file `luacov.default.lua` for an example). +-- If `configuration.reporter` is not set, runs the default reporter; -- otherwise, it must be a module name in 'luacov.reporter' namespace. -- The module must contain 'report' function, which is called without arguments. function runner.run_report(configuration) @@ -221,7 +221,7 @@ end -------------------------------------------------- -- Returns real name for a source file name --- using <code>modules</code> option. +-- using `luacov.defaults.modules` option. function runner.real_name(filename) local orig_filename = filename -- Normalize file names before using patterns. @@ -285,11 +285,11 @@ local default_config_file = ".luacov" ------------------------------------------------------ -- Loads a valid configuration. --- @param configuration user provided config (config-table or filename) +-- @param[opt] configuration user provided config (config-table or filename) -- @return existing configuration if already set, otherwise loads a new -- config from the provided data or the defaults. -- When loading a new config, if some options are missing, default values --- are used instead. +-- from `luacov.defaults` are used instead. function runner.load_config(configuration) if not runner.configuration then if not configuration then @@ -374,8 +374,8 @@ end -------------------------------------------------- -- Initializes LuaCov runner to start collecting data. --- @param configuration if string, filename of config file (used to call <code>load_config</code>). --- If table then config table (see file <code>luacov.default.lua</code> for an example) +-- @param[opt] configuration if string, filename of config file (used to call `load_config`). +-- If table then config table (see file `luacov.default.lua` for an example) function runner.init(configuration) runner.configuration = runner.load_config(configuration) stats.statsfile = runner.configuration.statsfile @@ -545,44 +545,45 @@ local function checkresult(ok, ...) end ------------------------------------------------------------------- --- Adds a file to the exclude list (see <code>defaults.lua</code>). +-- Adds a file to the exclude list (see `luacov.defaults`). -- If passed a function, then through debuginfo the source filename is collected. In case of a table -- it will recursively search the table for a function, which is then resolved to a filename through debuginfo. -- If the parameter is a string, it will first check if a file by that name exists. If it doesn't exist --- it will call <code>require(name)</code> to load a module by that name, and the result of require (function or +-- it will call `require(name)` to load a module by that name, and the result of require (function or -- table expected) is used as described above to get the sourcefile. --- @param name string; literal filename, --- string; modulename as passed to require(), --- function; where containing file is looked up, --- table; module table where containing file is looked up +-- @param name +-- * string; literal filename, +-- * string; modulename as passed to require(), +-- * function; where containing file is looked up, +-- * table; module table where containing file is looked up -- @return the pattern as added to the list, or nil + error function runner.excludefile(name) return checkresult(pcall(addfiletolist, name, runner.configuration.exclude)) end ------------------------------------------------------------------- --- Adds a file to the include list (see <code>defaults.lua</code>). --- @param name see <code>excludefile</code> +-- Adds a file to the include list (see `luacov.defaults`). +-- @param name see `excludefile` -- @return the pattern as added to the list, or nil + error function runner.includefile(name) return checkresult(pcall(addfiletolist, name, runner.configuration.include)) end ------------------------------------------------------------------- --- Adds a tree to the exclude list (see <code>defaults.lua</code>). --- If <code>name = 'luacov'</code> and <code>level = nil</code> then +-- Adds a tree to the exclude list (see `luacov.defaults`). +-- If `name = 'luacov'` and `level = nil` then -- module 'luacov' (luacov.lua) and the tree 'luacov' (containing `luacov/runner.lua` etc.) is excluded. --- If <code>name = 'pl.path'</code> and <code>level = true</code> then +-- If `name = 'pl.path'` and `level = true` then -- module 'pl' (pl.lua) and the tree 'pl' (containing `pl/path.lua` etc.) is excluded. -- NOTE: in case of an 'init.lua' file, the 'level' parameter will always be set --- @param name see <code>excludefile</code> +-- @param name see `excludefile` -- @param level if truthy then one level up is added, including the tree -- @return the 2 patterns as added to the list (file and tree), or nil + error function runner.excludetree(name, level) return checkresult(pcall(addtreetolist, name, level, runner.configuration.exclude)) end ------------------------------------------------------------------- --- Adds a tree to the include list (see <code>defaults.lua</code>). --- @param name see <code>excludefile</code> --- @param level see <code>includetree</code> +-- Adds a tree to the include list (see `luacov.defaults`). +-- @param name see `excludefile` +-- @param level see `includetree` -- @return the 2 patterns as added to the list (file and tree), or nil + error function runner.includetree(name, level) return checkresult(pcall(addtreetolist, name, level, runner.configuration.include)) diff --git a/src/luacov/stats.lua b/src/luacov/stats.lua index 78dc72b..30a7a48 100644 --- a/src/luacov/stats.lua +++ b/src/luacov/stats.lua @@ -1,6 +1,6 @@ ----------------------------------------------------- -- Manages the file with statistics (being) collected. --- In general the module requires that its property <code>stats.statsfile</code> +-- In general the module requires that its property `stats.statsfile` -- has been set to the filename of the statsfile to create, load, etc. -- @class module -- @name luacov.stats diff --git a/src/luacov/tick.lua b/src/luacov/tick.lua index e6640df..dbb43c6 100644 --- a/src/luacov/tick.lua +++ b/src/luacov/tick.lua @@ -4,5 +4,6 @@ -- a daemon (i.e., does not properly terminate). -- @class module -- @name luacov.tick +-- @see luacov.defaults.savestepsize require("luacov") return {} |