<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/87845/unit-testing-on-nrf-connect-zephyr-on-windows</link><description>Good morning, 
 
 I am trying to figure out how to write unit-tests using NRF Connect and Zephyr on Windows. Therefore I am trying to use unity as described here: 
 http://194.19.86.155/nRF_Connect_SDK/doc/latest/nrf/ug_unity_testing.html 
 It is not</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Thu, 02 Jun 2022 09:02:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/87845/unit-testing-on-nrf-connect-zephyr-on-windows" /><item><title>RE: Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/thread/370623?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 09:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caad4a3c-2b8a-47a7-96d6-ead72f5baa9d</guid><dc:creator>user77782</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry, my previous answer was wrong and it has been corrected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can build the&amp;nbsp;&lt;span&gt;tests/unity/example_test for DK and flash it to DK.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I test on nRF52840DK with &amp;quot;west build -b nRF52840dk_nrf52840 &amp;amp;&amp;amp; west flash&amp;quot; and get the follwoing result:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;*** Booting Zephyr OS build v2.7.99-ncs1-1  ***

src/example_test.c:28:test_uut_init:PASS

src/example_test.c:39:test_uut_init_with_param_check:PASS



-----------------------

2 Tests 0 Failures 0 Ignored

OK

PROJECT EXECUTION SUCCESSFUL
&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/thread/370596?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 07:44:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da0fde3f-fc79-46bc-82f4-341131fae06f</guid><dc:creator>user83996</dc:creator><description>&lt;p&gt;And how can we write unit-tests which run on the target hardware? Would that be possible with ztest? Can you provide an example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/thread/370594?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 07:39:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77b160a0-df12-46d3-a667-0d0b979f2804</guid><dc:creator>user77782</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, that unity in nRF Connect SDK can run on DK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/thread/370403?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2022 10:51:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5198d785-b761-4a09-abbe-8f7d19c616bd</guid><dc:creator>user83996</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;The example provided in &lt;span&gt;&lt;code&gt;tests/unity/example_test&lt;/code&gt;&lt;/span&gt; is for native_possix. Therefore is meant to build on the host. What I would like to get is an example of a unit-test to run in the nordic test-board.&lt;/p&gt;
&lt;p&gt;Could you please help me?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/thread/368959?ContentTypeID=1</link><pubDate>Mon, 23 May 2022 09:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23060b65-c7e1-41f7-904e-c8fb48465deb</guid><dc:creator>user77782</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="David Reimondez Garcia"]I have an additional question neither Unity nor Ztest support c++[/quote]
&lt;p&gt;&lt;span&gt;Ztest supports c++, and&amp;nbsp;Unity does not yet.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="David Reimondez Garcia"]&lt;p&gt;Do you have any recommendation? Which framework would you recommend to use c++?&lt;/p&gt;
&lt;p&gt;Or would you recommend not using c++ at all working with nrf Connect?&lt;/p&gt;[/quote]
&lt;p&gt;See my colleague Einar&amp;#39;s answer in &lt;a href="https://test-devzone.nordicsemi.com/f/nordic-q-a/79964/ncs-c-support"&gt;this post&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/thread/368025?ContentTypeID=1</link><pubDate>Mon, 16 May 2022 11:25:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a91cda9-e6a5-463b-8241-d8b2d33dc0a9</guid><dc:creator>user83996</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;Thanks for the feedback.&lt;/p&gt;
&lt;p&gt;I have an additional question neither Unity nor Ztest support c++&lt;/p&gt;
&lt;p&gt;Do you have any recommendation? Which framework would you recommend to use c++?&lt;/p&gt;
&lt;p&gt;Or would you recommend not using c++ at all working with nrf Connect?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit Testing on NRF Connect / Zephyr on Windows</title><link>https://test-devzone.nordicsemi.com/thread/367597?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 12:11:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e3373f6-ec62-4f0a-b15a-f211d245e3ee</guid><dc:creator>user77782</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]It is not clear to me if this test framework is prepared to run also in Windows. Is the board &amp;quot;native_posix&amp;quot; only supported on Linux at the moment?[/quote]
&lt;p&gt;&lt;span&gt;It has only been tested on Linux,&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.zephyrproject.org/latest/boards/posix/native_posix/doc/index.html"&gt;Native POSIX execution (native_posix) — Zephyr Project Documentation&lt;/a&gt;&lt;span&gt;, you can try WSL.&lt;/span&gt;&lt;/p&gt;
[quote user=""]Is there no way to run the tests on the target hardware using this framework? Could you provide some examples?[/quote]
&lt;p&gt;&lt;span&gt;An example for a unit test can be found in&amp;nbsp;&lt;code&gt;&lt;span&gt;tests/unity/example_test.&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span&gt;You can take a look at&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_unity_testing.html#id2"&gt;Setting up a unit test&lt;/a&gt;&amp;nbsp;doc.&lt;/p&gt;
&lt;p&gt;Here is a &lt;a href="https://test-devzone.nordicsemi.com/f/nordic-q-a/71705/sample-nrf-tests-unity-example_test-not-building-for-native_posix-board"&gt;similar case&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>