beremiz

a811e1ff718a
Tests: Add time emulation feature for tests with BEREMIZ_TEST_CYCLES CFLAG.

Adding BEREMIZ_TEST_CYCLES=1000 in a project's CFLAGS will:
- run 1000 cycles with no pause
- emulate time flowing normaly for PLC code
- exit PLC thread

This allows:
- testing standard library blocks that deal with time without having to wait
- unit testing and code coverage with POUs that uses time
<?xml version='1.0' encoding='utf-8'?>
<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<variables/>
<globals>
<xhtml:p><![CDATA[
import sys
def pfunc(arg):
sys.stdout.write(arg)
sys.stdout.flush()
pfunc("globals section\n")
]]></xhtml:p>
</globals>
<init>
<xhtml:p><![CDATA[
pfunc("init section\n")
]]></xhtml:p>
</init>
<cleanup>
<xhtml:p><![CDATA[
pfunc("cleanup section\n")
]]></xhtml:p>
</cleanup>
<start>
<xhtml:p><![CDATA[
pfunc("start section\n")
]]></xhtml:p>
</start>
<stop>
<xhtml:p><![CDATA[
pfunc("stop section\n")
]]></xhtml:p>
</stop>
</PyFile>