ya2 · news · projects · code · about

windows tests
authorFlavio Calva <f.calva@gmail.com>
Fri, 29 Apr 2022 18:36:02 +0000 (19:36 +0100)
committerFlavio Calva <f.calva@gmail.com>
Fri, 29 Apr 2022 18:36:02 +0000 (19:36 +0100)
lib/tools/functional_test.py
prj.org
tests/test_functional.py

index e8fd5f7b6da864d22530979fd13e466aa92cee2d..177bd333d15191aaf4daab0c1b4feb075e4576da 100644 (file)
@@ -58,8 +58,8 @@ class FunctionalTest(GameObject):
         self._curr_time += time
 
     def __mouse_click(self, pos, btn):
-        offset_x = int((1920 - 1360) / 2) + 1  # xfce decorations
-        offset_y = int((1080 - 768) / 2) + 24 + self._offset  # xfce decorations
+        offset_x = int((1920 - 1360) / 2) #+ 1  # xfce decorations
+        offset_y = int((1080 - 768) / 2) #+ 24 + self._offset  # xfce decorations
         btn = 3 if btn == 'right' else 1
         system('xdotool mousemove %s %s' % (offset_x + pos[0], offset_y + pos[1]))
         def click(task):
@@ -67,8 +67,8 @@ class FunctionalTest(GameObject):
         taskMgr.do_method_later(.01, click, 'click')
 
     def __mouse_drag(self, start, end, btn):
-        offset_x = int((1920 - 1360) / 2) + 1  # xfce decorations
-        offset_y = int((1080 - 768) / 2) + 24 + self._offset  # xfce decorations
+        offset_x = int((1920 - 1360) / 2) #+ 1  # xfce decorations
+        offset_y = int((1080 - 768) / 2) #+ 24 + self._offset  # xfce decorations
         btn = 3 if btn == 'right' else 1
         system('xdotool mousemove %s %s' % (offset_x + start[0], offset_y + start[1]))
         def mousedown(task):
diff --git a/prj.org b/prj.org
index e5778f107a383b3c5bf109e40a204857c4eab332..a9948ee5465318826fdebbb54014a027da43713f 100644 (file)
--- a/prj.org
+++ b/prj.org
@@ -3,8 +3,7 @@
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
-* RED windows build and test
-* READY itchio build and test
+* RED itchio build and test
 * READY restore test resolutions
 * READY restore test fullscreen
 * READY fix actions: rewind, prev, next                                 :bug:
index 9b50d3322347ac863bb5993f95a0920cd55823b2..7fad510ba4839350f220bda698fcba17668bdf2a 100644 (file)
@@ -145,16 +145,16 @@ class FunctionalTests(TestCase):
     #         'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
     #         str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
-    #def test_windows(self):
-    #    info('test_windows')
-    #    system('pkill -f "pmachines.exe"')
-    #    abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
-    #    self.__test_template(
-    #        'timeout 720s wine %s --functional-test & '
-    #        'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
-    #        'timeout 720s wine %s --functional-test & ' % (abspath, abspath) +
-    #        'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
-    #        str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
+    def test_windows(self):
+        info('test_windows')
+        system('pkill -f "pmachines.exe"')
+        abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
+        self.__test_template(
+            'timeout 720s wine %s --functional-test & ' % abspath +
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
+            'timeout 720s wine %s --functional-test & ' % abspath +
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
+            str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
 
     def test_versions(self):
         info('test_versions')
@@ -174,8 +174,7 @@ class FunctionalTests(TestCase):
         cmds = [
             ('timeout 720s ./build/manylinux2010_x86_64/pmachines --version', str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt'),
             ('timeout 720s ./dist/Pmachines-%s-x86_64.AppImage --version' % bld_branch, str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt'),
-            #('timeout 720s wine ./build/win_amd64/pmachines.exe --version', '/home/flavio/.wine/drive_c/users/flavio/AppData/Local/pmachines/obs_version.txt')
-            ]
+            ('timeout 720s wine ./build/win_amd64/pmachines.exe --version', '/home/flavio/.wine/drive_c/users/flavio/AppData/Local/pmachines/obs_version.txt')]
         #if environ.get('FUNCTIONALPOST') == '1':
         #    if _branch() == 'master':
         #        self.__update_itchio()