/usr/share/doc/racket/raco/test.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>13 raco test: Run tests</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco</span>:<span class="mywbr"> </span> Racket Command-<wbr></wbr>Line Tools</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="make.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco make</span>:<span class="mywbr"> </span> Compiling Source to Bytecode</a></td></tr><tr><td align="right">2 </td><td><a href="exe.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco exe</span>:<span class="mywbr"> </span> Creating Stand-<wbr></wbr>Alone Executables</a></td></tr><tr><td align="right">3 </td><td><a href="exe-dist.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco distribute</span>:<span class="mywbr"> </span> Sharing Stand-<wbr></wbr>Alone Executables</a></td></tr><tr><td align="right">4 </td><td><a href="planet.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco planet</span>:<span class="mywbr"> </span> Automatic Package Distribution</a></td></tr><tr><td align="right">5 </td><td><a href="pkg.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco pkg</span>:<span class="mywbr"> </span> Package Management</a></td></tr><tr><td align="right">6 </td><td><a href="setup.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco setup</span>:<span class="mywbr"> </span> Installation Management</a></td></tr><tr><td align="right">7 </td><td><a href="decompile.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco decompile</span>:<span class="mywbr"> </span> Decompiling Bytecode</a></td></tr><tr><td align="right">8 </td><td><a href="demod.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco demod</span>:<span class="mywbr"> </span> Demodularizing Programs</a></td></tr><tr><td align="right">9 </td><td><a href="link.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco link</span>:<span class="mywbr"> </span> Library Collection Links</a></td></tr><tr><td align="right">10 </td><td><a href="plt.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco pack</span>:<span class="mywbr"> </span> Packing Library Collections</a></td></tr><tr><td align="right">11 </td><td><a href="unpack.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco unpack</span>:<span class="mywbr"> </span> Unpacking Library Collections</a></td></tr><tr><td align="right">12 </td><td><a href="ctool.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco ctool</span>:<span class="mywbr"> </span> Working with C Code</a></td></tr><tr><td align="right">13 </td><td><a href="" class="tocviewselflink" data-pltdoc="x"><span class="stt">raco test</span>:<span class="mywbr"> </span> Run tests</a></td></tr><tr><td align="right">14 </td><td><a href="docs.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco docs</span>:<span class="mywbr"> </span> Documentation Search</a></td></tr><tr><td align="right">15 </td><td><a href="expand.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco expand</span>:<span class="mywbr"> </span> Macro Expansion</a></td></tr><tr><td align="right">16 </td><td><a href="read.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco read</span>:<span class="mywbr"> </span> Reading and Pretty-<wbr></wbr>Printing</a></td></tr><tr><td align="right">17 </td><td><a href="scribble.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco scribble</span>:<span class="mywbr"> </span> Building Documentation</a></td></tr><tr><td align="right">18 </td><td><a href="command.html" class="tocviewlink" data-pltdoc="x">Adding a <span class="stt">raco</span> Command</a></td></tr><tr><td align="right">19 </td><td><a href="config-file.html" class="tocviewlink" data-pltdoc="x">Installation Configuration and Search Paths</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">►</a></td><td>13 </td><td><a href="" class="tocviewselflink" data-pltdoc="x"><span class="stt">raco test</span>:<span class="mywbr"> </span> Run tests</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">13.1 </td><td><a href="#%28part._test-config%29" class="tocviewlink" data-pltdoc="x">Test Configuration by Submodule</a></td></tr><tr><td align="right">13.2 </td><td><a href="#%28part._test-config-info%29" class="tocviewlink" data-pltdoc="x">Test Configuration by <span class="stt">"info.rkt"</span></a></td></tr><tr><td align="right">13.3 </td><td><a href="#%28part._test-responsible%29" class="tocviewlink" data-pltdoc="x">Responsible-<wbr></wbr>Party and Varying-<wbr></wbr>Output Logging</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">13.1<tt> </tt></span><a href="#%28part._test-config%29" class="tocsubseclink" data-pltdoc="x">Test Configuration by Submodule</a></td></tr><tr><td><span class="tocsublinknumber">13.2<tt> </tt></span><a href="#%28part._test-config-info%29" class="tocsubseclink" data-pltdoc="x">Test Configuration by <span class="stt">"info.rkt"</span></a></td></tr><tr><td><span class="tocsublinknumber">13.3<tt> </tt></span><a href="#%28part._test-responsible%29" class="tocsubseclink" data-pltdoc="x">Responsible-<wbr></wbr>Party and Varying-<wbr></wbr>Output Logging</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="c-mods.html" title="backward to "12.2 Embedding Modules via C"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "raco: Racket Command-Line Tools"" data-pltdoc="x">up</a> <a href="docs.html" title="forward to "14 raco docs: Documentation Search"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "scribblings/raco/raco.scrbl")" x-source-pkg="racket-doc" x-part-tag=""test"">13<tt> </tt><a name="(part._test)"></a><span class="stt">raco test</span>: Run tests</h3><p>The <span class="stt">raco test</span> command requires and runs the (by default)
<span class="RktSym">test</span> submodule associated with each path given on the command
line. Command-line flags can control which submodule is run, whether to
run the main module if no submodule is found, and whether to run tests
directly, in separate processes (the default), or in separate places.
The current directory is set to a test file’s directory before running
the file.</p><p>When an argument path refers to a directory, <span class="stt">raco test</span>
recursively discovers and runs all files within the directory that end
in a module suffix (see <span class="RktSym"><a href="API_for_Raw_Compilation.html#%28def._%28%28lib._compiler%2Fmodule-suffix..rkt%29._get-module-suffixes%29%29" class="RktValLink" data-pltdoc="x">get-module-suffixes</a></span>, but the suffixes
always include <span class="stt">".rkt"</span>, <span class="stt">".scrbl"</span>, <span class="stt">".ss"</span>, and
<span class="stt">".scm"</span>) or have a (possibly empty) list of command-line arguments provided by
<span class="RktSym">test-command-line-arguments</span> in an <span class="stt">"info.rkt"</span> file,
or as directed by <span class="RktSym">test-include-paths</span> in an
<span class="stt">"info.rkt"</span> file. At the same time, <span class="stt">raco test</span> omits
files and directories within a directory as directed by
<span class="RktSym">test-omit-paths</span> in an <span class="stt">"info.rkt"</span> file.</p><p>A test is counted as failing if it logs a failing test code via
<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=rackunit&rel=Testing_Utilities.html%23%2528def._%2528%2528lib._rackunit%252Flog..rkt%2529._test-log%2521%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">test-log!</a></span>, causes Racket to exit with a non-zero exit code, or
(when <span class="nobreak"><span class="stt">-e</span></span> or <span class="nobreak"><span class="stt">--check-stderr</span></span> is specified) if it produces
output on the error port.</p><p>The <span class="stt">raco test</span> command accepts several flags:</p><ul><li><p><span class="nobreak"><span class="stt">-c</span></span> or <span class="nobreak"><span class="stt">--collection</span></span>
—<wbr></wbr> Interprets the arguments as collections whose content
should be tested (in the same way as directory content).</p></li><li><p><span class="nobreak"><span class="stt">-p</span></span> or <span class="nobreak"><span class="stt">--package</span></span>
—<wbr></wbr> Interprets the arguments as packages whose contents should
be tested (in the same way as directory content). All package
scopes are searched for the first, most specific <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=pkg&rel=Package_Concepts.html%23%2528tech._package._scope%2529&version=6.7" class="techoutside Sq" data-pltdoc="x"><span class="techinside">package scope</span></a>.</p></li><li><p><span class="nobreak"><span class="stt">-l</span></span> or <span class="nobreak"><span class="stt">--lib</span></span>
—<wbr></wbr> Interprets the arguments as libraries that should be tested.</p></li><li><p><span class="nobreak"><span class="stt">-m</span></span> or <span class="nobreak"><span class="stt">--modules</span></span>
—<wbr></wbr> Not only interprets the arguments as paths (which is the
default mode), but treats them the same as paths found in a
directory, which means ignoring a file argument that does not
have a module extension or is not enabled explicitly via
<span class="RktSym">test-command-line-arguments</span> or <span class="RktSym">test-include-paths</span>
in an <span class="stt">"info.rkt"</span> file; meanwhile, paths that are otherwise
enabled can be disabled via <span class="RktSym">test-omit-paths</span> in an
<span class="stt">"info.rkt"</span> file.</p></li><li><p><span class="nobreak"><span class="stt">--drdr</span></span>
—<wbr></wbr> Configures defaults to imitate the DrDr continuous testing
system: ignore non-modules, run tests in separate processes,
use as many jobs as available processors,
set the default timeout to 90 seconds,
create a fresh <span class="stt">PLTUSERHOME</span> and <span class="stt">TMPDIR</span> for each test,
count stderr output as a test failure,
quiet program output,
provide empty program input,
and print a table of results.</p></li><li><p><span class="nobreak"><span class="stt">-s</span></span> <span class="sroman">‹<span style="font-style: italic">name</span>›</span> or <span class="nobreak"><span class="stt">--submodule</span></span> <span class="sroman">‹<span style="font-style: italic">name</span>›</span>
—<wbr></wbr> Requires the submodule <span class="sroman">‹<span style="font-style: italic">name</span>›</span> rather than <span class="RktSym">test</span>.
Supply <span class="nobreak"><span class="stt">-s</span></span> or <span class="nobreak"><span class="stt">--submodule</span></span> to run multiple submodules,
or combine multiple submodules with <span class="nobreak"><span class="stt">--first-avail</span></span> to
run the first available of the listed modules.</p></li><li><p><span class="nobreak"><span class="stt">-r</span></span> or <span class="nobreak"><span class="stt">--run-if-absent</span></span>
—<wbr></wbr> Requires the top-level module of a file if a relevant submodule is not
present. This is the default mode.</p></li><li><p><span class="nobreak"><span class="stt">-x</span></span> or <span class="nobreak"><span class="stt">--no-run-if-absent</span></span>
—<wbr></wbr> Ignores a file if the relevant submodule is not present.</p></li><li><p><span class="nobreak"><span class="stt">--first-avail</span></span>
—<wbr></wbr> When multiple submodule names are provided with <span class="nobreak"><span class="stt">-s</span></span> or
<span class="nobreak"><span class="stt">--submodule</span></span>, runs only the first available submodule.</p></li><li><p><span class="nobreak"><span class="stt">--configure-runtime</span></span>
—<wbr></wbr> Run a <span class="RktSym">configure-runtime</span> submodule (if any) of
each specified module before the module or a
submodule is run. This mode is the default when only a single
module is provided or when <span class="nobreak"><span class="stt">--process</span></span> or <span class="nobreak"><span class="stt">--place</span></span>
mode is specified, unless a submodule name is provided
via <span class="nobreak"><span class="stt">-s</span></span> or <span class="nobreak"><span class="stt">--submodule</span></span>.</p></li><li><p><span class="nobreak"><span class="stt">--direct</span></span>
—<wbr></wbr> Runs each test in a thread. This mode is the default if
a single file is specified. Multiple tests can interfere with
each other and the overall test run by exiting, unsafe operations
that block (and thus prevent timeout), and so on.</p></li><li><p><span class="nobreak"><span class="stt">--process</span></span>
—<wbr></wbr> Runs each test in a separate operating-system process. This
mode is the default if multiple files are specified or if a
directory, collection, or package is specified.</p></li><li><p><span class="nobreak"><span class="stt">--place</span></span>
—<wbr></wbr> Runs each test in a <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=places.html%23%2528tech._place%2529&version=6.7" class="techoutside Sq" data-pltdoc="x"><span class="techinside">place</span></a>, instead of in an
operating-system process.</p></li><li><p><span class="nobreak"><span class="stt">-j</span></span> <span class="sroman">‹<span style="font-style: italic">n</span>›</span> or <span class="nobreak"><span class="stt">--jobs</span></span> <span class="sroman">‹<span style="font-style: italic">n</span>›</span>
—<wbr></wbr> Runs up to <span class="sroman">‹<span style="font-style: italic">n</span>›</span> tests in parallel.</p></li><li><p><span class="nobreak"><span class="stt">--timeout</span></span> <span class="sroman">‹<span style="font-style: italic">seconds</span>›</span>
—<wbr></wbr> Sets the default timeout (after which a test counts as failed)
to <span class="sroman">‹<span style="font-style: italic">seconds</span>›</span>. Use <span class="stt">+inf.0</span> to allow tests to run without
limit but allow <span class="RktSym">timeout</span> sub-submodule configuration.
If any test fails due to a timeout, the exit status of <span class="stt">raco test</span>
is 2 (as opposed to 1 for only non-timeout failures or 0 for success).</p></li><li><p><span class="nobreak"><span class="stt">--fresh-user</span></span>
—<wbr></wbr> When running tests in a separate process, creates a fresh
directory and sets <span class="stt">PLTUSERHOME</span> and <span class="stt">TMPDIR</span>. The
<span class="stt">PLTADDONDIR</span> environment variable is also set so that
the add-on directory (which is where packages are installed, for
example) does <span style="font-style: italic">not</span> change for each test process.</p></li><li><p><span class="nobreak"><span class="stt">--empty-stdin</span></span>
—<wbr></wbr> Provide an empty stdin to each test program.</p></li><li><p><span class="nobreak"><span class="stt">-Q</span></span> or <span class="nobreak"><span class="stt">--quiet-program</span></span>
—<wbr></wbr> Suppresses output from each test program.</p></li><li><p><span class="nobreak"><span class="stt">-e</span></span> or <span class="nobreak"><span class="stt">--check-stderr</span></span>
—<wbr></wbr> Count any stderr output as a test failure.</p></li><li><p><span class="nobreak"><span class="stt">++ignore-stderr</span></span> <span class="sroman">‹<span style="font-style: italic">pattern</span>›</span>
—<wbr></wbr> Don’t count stderr output as a test failure if it matches
<span class="sroman">‹<span style="font-style: italic">pattern</span>›</span>. This flag can be used multiple times, and
stderr output is treated as success as long as it matches any
one <span class="sroman">‹<span style="font-style: italic">pattern</span>›</span>.</p></li><li><p><span class="nobreak"><span class="stt">-q</span></span> or <span class="nobreak"><span class="stt">--quiet</span></span>
—<wbr></wbr> Suppresses output of progress information, responsible
parties, and varying output (see <a href="#%28part._test-responsible%29" data-pltdoc="x">Responsible-Party and Varying-Output Logging</a>).</p></li><li><p><span class="nobreak"><span class="stt">--heartbeat</span></span>
—<wbr></wbr> Periodically report that a test is still running after
the test has been running at least 5 seconds.</p></li><li><p><span class="nobreak"><span class="stt">--table</span></span> or <span class="nobreak"><span class="stt">-t</span></span>
—<wbr></wbr> Print a summary table after all tests. If a test uses
<a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=rackunit&rel=api.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">rackunit</span></a>, or if a test at least uses
<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=rackunit&rel=Testing_Utilities.html%23%2528def._%2528%2528lib._rackunit%252Flog..rkt%2529._test-log%2521%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">test-log!</a></span> from <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=rackunit&rel=Testing_Utilities.html%23%2528mod-path._rackunit%252Flog%2529&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">rackunit/log</span></a> to log
successes and failures, the table reports test and failure
counts based on the log.</p></li></ul><p class="SHistory">Changed in version 1.1: Added <span class="nobreak"><span class="stt">--heartbeat</span></span>. Changed in version 1.4: Changed recognition of module suffixes to use <span class="RktSym"><a href="API_for_Raw_Compilation.html#%28def._%28%28lib._compiler%2Fmodule-suffix..rkt%29._get-module-suffixes%29%29" class="RktValLink" data-pltdoc="x">get-module-suffixes</a></span>,
which implies recognizing <span class="stt">".ss"</span> and <span class="stt">".rkt"</span>.</p><h4 x-source-module="(lib "scribblings/raco/raco.scrbl")" x-source-pkg="racket-doc" x-part-tag=""test-config"">13.1<tt> </tt><a name="(part._test-config)"></a>Test Configuration by Submodule</h4><p>When <span class="stt">raco test</span> runs a test in a submodule, a <span class="RktSym">config</span>
sub-submodule can provide additional configuration for running the
test. The <span class="RktSym">config</span> sub-submodule should use the
<a href="info_rkt.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">info</span></a> module language to define the following
identifiers:</p><ul><li><p><span class="RktSym">timeout</span> —<wbr></wbr> a real number to override the default
timeout for the test, which applies only when timeouts are
enabled.</p></li><li><p><span class="RktSym">responsible</span> —<wbr></wbr> a string, symbol, or list of symbols
and strings identifying a responsible party that should be
notified when the test fails. See <a href="#%28part._test-responsible%29" data-pltdoc="x">Responsible-Party and Varying-Output Logging</a>.</p></li><li><p><span class="RktSym">lock-name</span> —<wbr></wbr> a string that names a lock file that is
used to serialize tests (i.e., tests that have the same lock
name do not run concurrently). The lock file’s location is
determined by the <span class="stt">PLTLOCKDIR</span> enviornment varible or
defaults to <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=Filesystem.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._find-system-path%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">temp-dir</span><span class="RktPn">)</span>. The maximum
time to wait on the lock file is determined by the
<span class="stt">PLTLOCKTIME</span> environment variable or defaults to 4
hours.</p></li><li><p><span class="RktSym">random?</span> —<wbr></wbr> if true, indicates that the test’s output
is expected to vary. See <a href="#%28part._test-responsible%29" data-pltdoc="x">Responsible-Party and Varying-Output Logging</a>.</p></li></ul><p>In order to prevent evaluation of a file for testing purposes, it
suffices to create a submodule that does not perform any tests and
does not trigger the evaluation of the enclosing module. So, for
instance, a file might look like this:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252F%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">/</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">don</span><span class="RktCmt">'</span><span class="RktCmt">t run this file for testing:</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=module.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._module%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">module</a></span><span class="hspace"> </span><span class="RktSym">test</span><span class="hspace"> </span><span class="RktSym">racket/base</span><span class="RktPn">)</span></td></tr></table></blockquote><h4 x-source-module="(lib "scribblings/raco/raco.scrbl")" x-source-pkg="racket-doc" x-part-tag=""test-config-info"">13.2<tt> </tt><a name="(part._test-config-info)"></a>Test Configuration by <span class="stt">"info.rkt"</span></h4><p>Submodule-based test configuration is preferred (see
<a href="#%28part._test-config%29" data-pltdoc="x">Test Configuration by Submodule</a>). In particular, to prevent <span class="stt">raco test</span>
from running a particular file, normally the file should contain a
submodule that takes no action.</p><p>In some cases, however, adding a submodule is inconvenient or
impossible (e.g., because the file will not always compile). Thus,
<span class="stt">raco test</span> also consults any <span class="stt">"info.rkt"</span> file in the
candidate test file’s directory. In the case of a file within a
collection, <span class="stt">"info.rkt"</span> files from any enclosing collection
directories are also consulted for <span class="RktSym">test-omit-paths</span> and
<span class="RktSym">test-include-paths</span>. Finally, for a file within a package, the
package’s <span class="stt">"info.rkt"</span> is consulted for <span class="RktSym">pkg-authors</span> to
set the default responsible parties (see <a href="#%28part._test-responsible%29" data-pltdoc="x">Responsible-Party and Varying-Output Logging</a>)
for all files in the package.</p><p>The following <span class="stt">"info.rkt"</span> fields are recognized:</p><ul><li><p><span class="RktSym">test-omit-paths</span> —<wbr></wbr> a list of path strings (relative
to the enclosing directory) and regexp values (to omit all
files within the enclosing directory matching the expression),
or <span class="RktVal">'</span><span class="RktVal">all</span> to omit all files within the enclosing directory.
When a path string refers to a directory, all files within the
directory are omitted.</p></li><li><p><span class="RktSym">test-include-paths</span> —<wbr></wbr> a list of path strings (relative
to the enclosing directory) and regexp values (to include all
files within the enclosing directory matching the expression),
or <span class="RktVal">'</span><span class="RktVal">all</span> to include all files within the enclosing directory.
When a path string refers to a directory, all files within the
directory are included.</p></li><li><p><span class="RktSym">test-command-line-arguments</span> —<wbr></wbr> a list of
<span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVar">module-path-string</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVar">argument-path-string</span><span class="stt"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span><span class="RktPn">)</span>, where <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=runtime.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-command-line-arguments%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">current-command-line-arguments</a></span> is set to
a vector that contains the <span class="RktVar">argument-path-string</span> when
running <span class="RktVar">module-path-string</span>.</p></li><li><p><span class="RktSym">test-timeouts</span> —<wbr></wbr> a list of <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVar">module-path-string</span><span class="stt"> </span><span class="RktVar">real-number</span><span class="RktPn">)</span> to override the default
timeout for <span class="RktVar">module-path-string</span>.</p></li><li><p><span class="RktSym">test-responsibles</span> —<wbr></wbr> a list of <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVar">module-path-string</span><span class="stt"> </span><span class="RktVar">party</span><span class="RktPn">)</span> or <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">all</span><span class="stt"> </span><span class="RktVar">party</span><span class="RktPn">)</span> to
override the default responsible party for
<span class="RktVar">module-path-string</span> or all files within the directory
(except as overridden), respectively. Each <span class="RktVar">party</span> is a
string, symbol, or list of symbols and strings. See
<a href="#%28part._test-responsible%29" data-pltdoc="x">Responsible-Party and Varying-Output Logging</a>.</p></li><li><p><span class="RktSym">test-lock-names</span> —<wbr></wbr> a list of <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktVar">module-path-string</span><span class="stt"> </span><span class="RktVar">lock-string</span><span class="RktPn">)</span> to declare a lock file name
for <span class="RktVar">module-path-string</span>. See <span class="RktSym">lock-name</span> in
<a href="#%28part._test-config%29" data-pltdoc="x">Test Configuration by Submodule</a>.</p></li><li><p><span class="RktSym">test-randoms</span> —<wbr></wbr> a list of path strings (relative to
the enclosing directory) for modules whose output varies.
See <a href="#%28part._test-responsible%29" data-pltdoc="x">Responsible-Party and Varying-Output Logging</a>.</p></li><li><p><span class="RktSym">module-suffixes</span> and <span class="RktSym">doc-module-suffixes</span> —<wbr></wbr>
Used indirectly via <span class="RktSym"><a href="API_for_Raw_Compilation.html#%28def._%28%28lib._compiler%2Fmodule-suffix..rkt%29._get-module-suffixes%29%29" class="RktValLink" data-pltdoc="x">get-module-suffixes</a></span>.</p></li></ul><h4 x-source-module="(lib "scribblings/raco/raco.scrbl")" x-source-pkg="racket-doc" x-part-tag=""test-responsible"">13.3<tt> </tt><a name="(part._test-responsible)"></a>Responsible-Party and Varying-Output Logging</h4><p>When a test has a declared responsible party, then the test’s output
is prefixed with a</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">raco test:</span><span class="sroman">‹<span style="font-style: italic">which</span>›</span><span class="stt"></span><span class="hspace"> </span><span class="stt">@(test-responsible '</span><span class="sroman">‹<span style="font-style: italic">responsible</span>›</span><span class="stt">)</span></p></td></tr></table></p><p>line, where <span class="sroman">‹<span style="font-style: italic">which</span>›</span> is a space followed by an exact
non-negative number indicating a parallel task when parallelism is
enabled (or empty otherwise), and <span class="sroman">‹<span style="font-style: italic">responsible</span>›</span> is a string,
symbol, or list datum.</p><p>When a test’s output (as written to stdout) is expected to vary across
runs—<wbr></wbr>aside from varying output that has the same form as produced by
<span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=time.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fmore-scheme..rkt%2529._time%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">time</a></span>—<wbr></wbr>then it should be declared as varying. In that case,
the test’s output is prefixed with a</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">raco test:</span><span class="sroman">‹<span style="font-style: italic">which</span>›</span><span class="stt"></span><span class="hspace"> </span><span class="stt">@(test-random #t)</span></p></td></tr></table></p><p>line.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="c-mods.html" title="backward to "12.2 Embedding Modules via C"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "raco: Racket Command-Line Tools"" data-pltdoc="x">up</a> <a href="docs.html" title="forward to "14 raco docs: Documentation Search"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|