--- a/exemples/python/plc.xml Mon Jul 04 08:35:47 2022 +0200
+++ b/exemples/python/plc.xml Mon Jul 04 08:44:23 2022 +0200
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:21:19" contentDescription="This example shows many features in Beremiz: 1. How to implement python extensions. 2. How to implement basic C extension. 3. How to use C code in IEC POUs. 4. How to call C functions from python code. 5. How to avoid race conditions between IEC, C and python code. 6. How to convert betweet different IEC types. "/>
- <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2020-10-19T23:53:08">
+ <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2022-07-03T16:04:31"> <pageSize x="1024" y="1024"/>
@@ -269,12 +269,12 @@
- <inVariable localId="4" height="30" width="160" executionOrderId="0" negated="false">
- <position x="295" y="450"/>
+ <inVariable localId="4" height="30" width="315" executionOrderId="0" negated="false"> + <position x="200" y="390"/> - <relPosition x="160" y="15"/>
+ <relPosition x="315" y="15"/> - <expression>'666'</expression>
+ <expression>'sys.stdout.write("Hello world\n")'</expression> <block localId="5" width="125" height="80" typeName="python_eval" instanceName="py1" executionOrderId="0">
<position x="686" y="400"/>
@@ -293,9 +293,11 @@
<variable formalParameter="CODE">
<relPosition x="0" y="65"/>
- <connection refLocalId="4">
+ <connection refLocalId="80" formalParameter="OUT"> <position x="686" y="465"/>
- <position x="455" y="465"/>
+ <position x="653" y="465"/> + <position x="653" y="485"/> + <position x="630" y="485"/> @@ -739,12 +741,6 @@
Happy hacking! ]]></xhtml:p>
- <comment localId="31" height="90" width="345">
- <position x="295" y="485"/>
- <xhtml:p><![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]></xhtml:p>
<comment localId="6" height="80" width="345">
<position x="295" y="630"/>
@@ -1443,10 +1439,10 @@
<expression>Test_Python_Var</expression>
- <inVariable localId="79" executionOrderId="0" height="25" width="30" negated="false">
+ <inVariable localId="79" executionOrderId="0" height="27" width="30" negated="false"> <position x="560" y="1340"/>
- <relPosition x="30" y="10"/>
+ <relPosition x="30" y="15"/> <expression>23</expression>
@@ -1464,6 +1460,44 @@
<expression>SomeVarName</expression>
+ <block localId="80" typeName="MOVE" executionOrderId="0" height="40" width="60"> + <position x="570" y="455"/> + <variable formalParameter="IN"> + <relPosition x="0" y="30"/> + <connection refLocalId="82"> + <position x="578" y="485"/> + <position x="532" y="485"/> + <variable formalParameter="OUT"> + <relPosition x="60" y="30"/> + <connector name="Connection0" localId="81" height="30" width="130"> + <position x="545" y="390"/> + <relPosition x="0" y="15"/> + <connection refLocalId="4"> + <position x="545" y="405"/> + <position x="515" y="405"/> + <continuation name="Connection0" localId="82" height="30" width="130"> + <position x="410" y="470"/> + <relPosition x="130" y="15"/> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/ide_tests/debug_project.sikuli/debug_project.py Mon Jul 04 08:44:23 2022 +0200
@@ -0,0 +1,68 @@
+""" This test opens, modifies, builds and runs exemple project named "python". +Test succeeds if runtime's stdout behaves as expected +# allow module import from current test directory's parent +addImportPath(os.path.dirname(getBundlePath())) +# common test definitions module +from sikuliberemiz import run_test + app.waitForChangeAndIdleStdout() + app.waitForChangeAndIdleStdout() + app.waitForChangeAndIdleStdout() + app.waitForChangeAndIdleStdout() + app.click("1646062660770.png") + app.click("1646066996789.png") + app.type(Key.DOWN * 10, Key.CTRL) + # wait up to 10 seconds for 10 Grumpfs + app.waitPatternInStdout("Grumpf", 10, 10) + app.rightClick("1646066996790.png") + app.type("'sys.stdout.write(\"DEBUG TEST OK\\n\")'") + # wait 10 seconds for 10 patterns + return app.waitPatternInStdout("DEBUG TEST OK", 10) +run_test(test, exemple="python") --- a/tests/ide_tests/edit_project.sikuli/edit_project.py Mon Jul 04 08:35:47 2022 +0200
+++ b/tests/ide_tests/edit_project.sikuli/edit_project.py Mon Jul 04 08:44:23 2022 +0200
@@ -25,7 +25,7 @@
- app.doubleClick("1646066996620.png")
+ app.doubleClick("Hello world") --- a/tests/ide_tests/sikuliberemiz.py Mon Jul 04 08:35:47 2022 +0200
+++ b/tests/ide_tests/sikuliberemiz.py Mon Jul 04 08:44:23 2022 +0200
@@ -29,6 +29,7 @@
"Connect": sikuli.Key.F7,
+ "SelectAll":("a",sikuli.Key.CTRL), "Save": ("s",sikuli.Key.CTRL),
"New": ("n",sikuli.Key.CTRL),
"Address": ("l",sikuli.Key.CTRL)} # to reach address bar in GTK's file selector
@@ -110,6 +111,9 @@
self.thread = Thread(target = self._waitStdoutProc).start()
+ pass # self.thread.join() ? def _waitStdoutProc(self):
a = self.proc.stdout.readline()
@@ -265,11 +269,11 @@
stdoutIdleObserver.__init__(self)
# stubs for common sikuli calls to allow adding hooks later
- for name in ["click","doubleClick","type"]:
+ for name in ["click","doubleClick","type","rightClick","wait"]: def myMeth(*args, **kwargs):
+ self.ReportScreenShot(n + "(" + repr(args) + "," + repr(kwargs) + ")") getattr(sikuli, n)(*args, **kwargs)
- self.ReportScreenShot(n + "(" + repr(args) + "," + repr(kwargs) + ")")
setattr(self, name, makeMyMeth(name))