Skip to content

Commit b47c96e

Browse files
author
pyocd-bot
committed
Deploying to main from @ pyocd/pyocd-website-source@596083b 🚀
1 parent 301ddae commit b47c96e

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

docs/automated_tests.html

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ <h1 class="mb-4 mt-0">Automated tests</h1>
212212
<div class="sidebar docs-sidebar-2 p-4">
213213
<h5 class="sidebar-header">On this page</h5>
214214
<ul id="toc" class="section-nav">
215+
<li class="toc-entry toc-h2"><a href="#test-setup">Test Setup</a></li>
215216
<li class="toc-entry toc-h2"><a href="#unit-tests">Unit tests</a></li>
216217
<li class="toc-entry toc-h2"><a href="#functional-tests">Functional tests</a></li>
217218
<li class="toc-entry toc-h2"><a href="#azure-pipelines">Azure Pipelines</a></li>
218219
<li class="toc-entry toc-h2"><a href="#testing-with-tox">Testing with tox</a></li>
219-
<li class="toc-entry toc-h2"><a href="#test-setup">Test Setup</a></li>
220220
</ul>
221221
</div>
222222
</div>
@@ -228,6 +228,29 @@ <h5 class="sidebar-header">On this page</h5>
228228
but those tests will be skipped if no probe is present. In contrast, all functional tests require
229229
at least one probe to be connected.</p>
230230

231+
<h2 id="test-setup">Test Setup</h2>
232+
233+
<p>For test setup it is good practice to create a virtualenv in the repos root subdirectory. Otherwise expect weird
234+
behavior during tests.</p>
235+
236+
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>python <span class="nt">-mvenv</span> <span class="nt">--upgrade-deps</span> .venv
237+
<span class="nv">$ </span><span class="nb">source</span> .venv/bin/activate
238+
<span class="nv">$ </span>pip <span class="nb">install</span> <span class="nt">-e</span> .[test]
239+
<span class="nv">$ </span>pytest
240+
</code></pre></div></div>
241+
242+
<p>To make the tests pick the correct setup, a <a href="configuration.md"><code class="highlighter-rouge">pyocd.yaml</code> configuration file</a> has to be used.
243+
For functional testing the file should contain a reference to a <code class="highlighter-rouge">test_binary</code> from <code class="highlighter-rouge">test/data/binaries</code>.</p>
244+
245+
<p>Example config file:</p>
246+
247+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">probes</span><span class="pi">:</span>
248+
<span class="na">E6614103E7176A23</span><span class="pi">:</span> <span class="c1"># Probe's unique ID.</span>
249+
<span class="na">target_override</span><span class="pi">:</span> <span class="s">nrf52</span>
250+
<span class="na">test_binary</span><span class="pi">:</span> <span class="s">l1_nrf52840-dk.bin</span>
251+
<span class="na">frequency</span><span class="pi">:</span> <span class="m">6000000</span>
252+
</code></pre></div></div>
253+
231254
<h2 id="unit-tests">Unit tests</h2>
232255

233256
<p>The unit tests are located in the <code class="highlighter-rouge">tests/unit</code> directory of the repo. They must be executed using
@@ -298,20 +321,6 @@ <h2 id="testing-with-tox">Testing with tox</h2>
298321

299322
<p>Currently only the functions tests are included in the tox configuration.</p>
300323

301-
<h2 id="test-setup">Test Setup</h2>
302-
303-
<p>To make the tests pick the correct setup, a <a href="configuration.md"><code class="highlighter-rouge">pyocd.yaml</code> configuration file</a> has to be used.
304-
For functional testing the file should contain a reference to a <code class="highlighter-rouge">test_binary</code> from <code class="highlighter-rouge">test/data/binaries</code>.</p>
305-
306-
<p>Example config file:</p>
307-
308-
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">probes</span><span class="pi">:</span>
309-
<span class="na">E6614103E7176A23</span><span class="pi">:</span> <span class="c1"># Probe's unique ID.</span>
310-
<span class="na">target_override</span><span class="pi">:</span> <span class="s">nrf52</span>
311-
<span class="na">test_binary</span><span class="pi">:</span> <span class="s">l1_nrf52840-dk.bin</span>
312-
<span class="na">frequency</span><span class="pi">:</span> <span class="m">6000000</span>
313-
</code></pre></div></div>
314-
315324

316325
</div>
317326
</div>

0 commit comments

Comments
 (0)