-d:nimtestParallelDisabled

This commit is contained in:
Ștefan Talpalaru 2019-05-29 16:33:25 +02:00
parent 37d4ee81df
commit 30c7d332d8
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
2 changed files with 7 additions and 2 deletions

View File

@ -1428,6 +1428,7 @@ nim c -r --threads:on -d:nimtestParallel testfile.nim
# or
NIMTEST_PARALLEL=1 nim c -r --threads:on testfile.nim</pre><p>There are some implicit barriers where we wait for all the spawned jobs to complete: before and after each test suite and at the main thread's exit.</p>
<p>The suite-related barriers are there to avoid mixing test output, but they also affect which groups of tests can be run in parallel, so keep them in mind when deciding how many tests to place in different suites (or between suites).</p>
<p>You may sometimes need to disable test parallelisation for a specific test, even though it was enabled in some configuration file in a parent dir. Do this with &quot;-d:nimtestParallelDisabled&quot; which overrides everything else.</p>
<h2><a class="toc-backref" id="running-tests-in-parallel-example" href="#running-tests-in-parallel-example">Example</a></h2><pre class="listing"><span class="Identifier">suite</span> <span class="StringLit">&quot;description for this stuff&quot;</span><span class="Punctuation">:</span>
<span class="Identifier">echo</span> <span class="StringLit">&quot;suite setup: run once before the tests&quot;</span>
@ -1819,7 +1820,7 @@ Same as <cite>check</cite> except any failed test causes the program to quit imm
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-28 21:58:58 UTC</small>
<small>Made with Nim. Generated: 2019-05-29 14:32:15 UTC</small>
</div>
</div>
</div>

View File

@ -77,6 +77,10 @@
## mind when deciding how many tests to place in different suites (or between
## suites).
##
## You may sometimes need to disable test parallelisation for a specific test,
## even though it was enabled in some configuration file in a parent dir. Do
## this with "-d:nimtestParallelDisabled" which overrides everything else.
##
## Example
## -------
##
@ -118,7 +122,7 @@ when not defined(ECMAScript):
import terminal
when declared(stdout):
const paralleliseTests* = existsEnv("NIMTEST_PARALLEL") or defined(nimtestParallel)
const paralleliseTests* = (existsEnv("NIMTEST_PARALLEL") or defined(nimtestParallel) and not defined(nimtestParallelDisabled))
## Whether parallel test running was enabled (set at compile time).
## This constant might be useful in custom output formatters.
else: