<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://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>Make module tests use common prj.conf configuration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98321/make-module-tests-use-common-prj-conf-configuration</link><description>Windows 11, VSCode, NCS v2.3.0 
 I am writing tests for a module. The module has code which is very interdependent upon itself. Any test will require nearly the same prj.conf files. 
 When I use twister to run a test, is there a way to have each test</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Apr 2023 11:50:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98321/make-module-tests-use-common-prj-conf-configuration" /><item><title>RE: Make module tests use common prj.conf configuration</title><link>https://devzone.nordicsemi.com/thread/422491?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 11:50:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ddc62c6-9202-438d-851e-6760bbe2350a</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;How are your modules and tests built up? Do they each contain a CMakeLists.txt and a prj.conf? If they do, then something like what I described should work.&lt;/p&gt;
&lt;p&gt;Could you show me how the file structure looks, and how you switch from one test to another? I could make this ticket private first if you&amp;#39;d like.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Make module tests use common prj.conf configuration</title><link>https://devzone.nordicsemi.com/thread/421055?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 13:27:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b2da6ab-d559-4e6d-a239-14dc263f6799</guid><dc:creator>douglas.malnati</dc:creator><description>&lt;p&gt;Hi Oivind,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I see.&amp;nbsp; Can that work with multiple modules, though?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As in, today, I have a single module that I want to be able to add to a project, and have its prj.conf values automatically set.&lt;/p&gt;
&lt;p&gt;Tomorrow, I have a second module I want to be able to do the same with.&lt;/p&gt;
&lt;p&gt;Etc.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I know, for example, that building against a specific board allows that board definition to have a prj.conf configuration independent of the build.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s basically what I&amp;#39;m looking for, per-module.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does that make sense?&amp;nbsp; Can you say how I can do that?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I wonder if snippits could be used for this somehow?&amp;nbsp; Like, instead of including a specific module in my project, instead I include a snippit, and that snippit includes the module as well as the prj.conf values?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think snippits are only in the latest zephyr, which is beyond the version supported by NCS?&amp;nbsp; Do you know when snippits will be supported?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Make module tests use common prj.conf configuration</title><link>https://devzone.nordicsemi.com/thread/420296?ContentTypeID=1</link><pubDate>Thu, 13 Apr 2023 14:23:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd4280ff-e13f-4cfd-8e46-62acb1f4571d</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It sounds like what you are trying to achieve can be done using the variables CONF_FILE and OVERLAY_CONFIG.&lt;br /&gt;Create a test_common.conf file which contains all the common configs, then create one additional testX.conf file for each test with its specific configs. &lt;br /&gt;test1.conf, test2.conf etc.&lt;/p&gt;
&lt;p&gt;For each test:&lt;br /&gt;Set the CONF_FILE variable to test_common.conf&lt;br /&gt;Set the OVERLAY_CONFIG variable to testX.conf&lt;/p&gt;
&lt;p&gt;This can be done in the test&amp;#39;s CMakeLists.txt file, on the line after cmake_minimum_required() :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)

set(CONF_FILE ../test_common.conf)
set(OVERLAY_CONFIG test1.conf)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Of course, set the names and paths of the files however you like.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>