<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Looking for example how to utilize UnitTestingDefine</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e422c7ff51/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e422c7ff51/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/e422c7ff51/</id><updated>2021-06-15T06:24:42.848000Z</updated><subtitle>Recent posts to Looking for example how to utilize UnitTestingDefine</subtitle><entry><title>Looking for example how to utilize UnitTestingDefine</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e422c7ff51/?limit=25#19e5" rel="alternate"/><published>2021-06-15T06:24:42.848000Z</published><updated>2021-06-15T06:24:42.848000Z</updated><author><name>pasi-p-sand</name><uri>https://forge.codesys.com/u/pasi-p-sand/</uri></author><id>https://forge.codesys.com57174df1bba29fbe0b39deae5e15d0d737380360</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I've been busy with other stuff for a while but now this issue is again on the table.&lt;/p&gt;
&lt;p&gt;Yes, it is requirement from system architecture that unit tests are not implemented inside the library, so it is not doable for me. I also think that it is good practise since we want to keep the library 'clean'.&lt;/p&gt;
&lt;p&gt;Now back to my original problem. I want to call every FB and method defined in library-under-testing. I have defined another library (don't know whats the benefit of having a library instead of project) which contains only unit testing code. I have defined UNIT_TESTING in application properties (Build tab) of this library. I also have defined new UnitTestingDefine as "UNIT_TESTING" inside library-under-testing.&lt;/p&gt;
&lt;p&gt;Now the issue. Documentation says that defining UnitTestingDefine with a string (in this case UNIT_TESTING) should make compiler to ignore INTERNAL and PRIVATE keywords (among others). I have done that but still the unit testing library cannot see the FB in library-under-testing if it is defined with INTERNAL keyword. If the keyword is removed, build finishes without errors.&lt;br/&gt;
Methods can have PRIVATE keyword and those are ignored with UnitTestingDefine.&lt;/p&gt;
&lt;p&gt;Have I misunderstood something? Should UnitTestingDefine be used some other way?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Looking for example how to utilize UnitTestingDefine</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e422c7ff51/?limit=250#5572" rel="alternate"/><published>2021-06-03T07:41:15.485000Z</published><updated>2021-06-03T07:41:15.485000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.com5f2cca05899644a0e13e8075cfe8e02e78486609</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;Unit tests cannot be inside the library.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This statement is wrong since unit tests could be implemented into the same library that the production code resides in. I therefore assume this is a prerequisite or a customer wish?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Looking for example how to utilize UnitTestingDefine</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e422c7ff51/?limit=250#35a3" rel="alternate"/><published>2021-06-03T07:25:06.773000Z</published><updated>2021-06-03T07:25:06.773000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.com7bcfde224aa7997c2da4dcf35b96ee91af0356df</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;See usage anwser here: &lt;a href="https://forge.codesys.com/prj/cfunit/questions/17/"&gt;https://forge.codesys.com/prj/cfunit/questions/17/&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Looking for example how to utilize UnitTestingDefine</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e422c7ff51/?limit=25#805e" rel="alternate"/><published>2021-06-03T07:01:03.559000Z</published><updated>2021-06-03T07:01:03.559000Z</updated><author><name>pasi-p-sand</name><uri>https://forge.codesys.com/u/pasi-p-sand/</uri></author><id>https://forge.codesys.com167deb56934eaca419ae944312f8badbd1a0996b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I need to implement unit tests for a library and to do that efficiently I also need to have access to on-public POUs inside the library. Unit tests cannot be inside the library. I found this page from Online help (https://help.codesys.com/webapp/properties;product=LibDevSummary;version=3.5.17.0) which indicates that there is UnitTestingDefine definition that could be used for changing the visibility during compilation. Some more info in here (https://help.codesys.com/webapp/visibility;product=LibDevSummary;version=3.5.17.0) but I would like to see how it is used in practice.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>