ya2 · news · projects · code · about

functional tests: windows
authorFlavio Calva <f.calva@gmail.com>
Wed, 13 Apr 2022 18:36:54 +0000 (19:36 +0100)
committerFlavio Calva <f.calva@gmail.com>
Wed, 13 Apr 2022 18:36:54 +0000 (19:36 +0100)
game/music.py
prj.org
tests/test_functional.py

index d186c97afcac1daf34c1ade4294bcc6878acc341..cf6c0c9bb3207d6d51eadcb49e2a52ee7456eefa 100644 (file)
@@ -1,4 +1,4 @@
-from os.path import dirname, exists
+from os.path import dirname, exists, basename
 from platform import system
 from glob import glob
 from pathlib import Path
@@ -46,7 +46,10 @@ class MusicMgr:
 
     def _on_frame(self, task):
         if self._music.status() == AudioSound.READY:
-            files = glob(self.curr_path + 'assets/audio/music/*.ogg')
-            files.remove(self.curr_path + 'assets/audio/music/' + self._music.get_name())
+            oggs = Filename(self.curr_path + 'assets/audio/music/*.ogg').to_os_specific()
+            files = glob(oggs)
+            rm_music = Filename(self.curr_path + 'assets/audio/music/' + basename(self._music.get_name())).to_os_specific()
+            # basename is needed in windows
+            files.remove(rm_music)
             self._start_music(files)
         return task.cont
diff --git a/prj.org b/prj.org
index 261c0b9194f6f8c39a8f8a10c5d2bed4a2e89c28..4d8b134bbce4e1f886f6dbc194bb4d778e8ac708 100644 (file)
--- a/prj.org
+++ b/prj.org
@@ -11,8 +11,8 @@
     - [X] save-restore options
     - [X] code
     - [X] appimage
+    - [X] windows
     - [ ] flatpak
-    - [ ] windows
     - [ ] itchio
     - [ ] versions
 ** READY management of error and success (upload builds, itch.io)
index a53961f0828c66fec97bd18146700e1e72af7cc9..db96fa9a990b0c6d4d05d52fde47d0dcc70dcd56 100644 (file)
@@ -130,14 +130,14 @@ class FunctionalTests(TestCase):
     #         '/home/flavio/.config/itch/apps/pmachines/pmachines --functional-test 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 1 ; '
-            'timeout 720s wine %s --functional-test 2' % (abspath, abspath),
-            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 1 ; '
+            'timeout 720s wine %s --functional-test 2' % (abspath, abspath),
+            str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
 
     # def test_versions(self):
     #     info('test_versions')