ya2 · news · projects · code · about

do not do asserts at runtime
authorFlavio Calva <f.calva@gmail.com>
Mon, 25 Jul 2022 17:46:32 +0000 (18:46 +0100)
committerFlavio Calva <f.calva@gmail.com>
Mon, 25 Jul 2022 17:46:32 +0000 (18:46 +0100)
pmachines/app.py
prj.org

index 153ba718fc2cba436f7bbf09219f6cec6fe5f49d..994b0fab35546bcad438ee5b0a84db7434ff6b0f 100755 (executable)
@@ -58,7 +58,7 @@ class MainFsm(FSM):
 
     def __do_asserts(self):
         args = self._pmachines._args
 
     def __do_asserts(self):
         args = self._pmachines._args
-        if True:  # args.functional_test or args.functional_ref:
+        if not LibP3d.runtime() or args.functional_test or args.functional_ref:
             assert_threads()
             assert_tasks()
             assert_render3d()
             assert_threads()
             assert_tasks()
             assert_render3d()
@@ -117,8 +117,9 @@ class PmachinesApp:
             self._fsm.demand('Menu')
         if args.functional_test or args.functional_ref:
             FunctionalTest(args.functional_ref, self._pos_mgr)
             self._fsm.demand('Menu')
         if args.functional_test or args.functional_ref:
             FunctionalTest(args.functional_ref, self._pos_mgr)
-        self.__fps_lst = []
-        taskMgr.do_method_later(1.0, self.__assert_fps, 'assert_fps')
+        if not LibP3d.runtime() or args.functional_test or args.functional_ref:
+            self.__fps_lst = []
+            taskMgr.do_method_later(1.0, self.__assert_fps, 'assert_fps')
 
     def on_menu_enter(self):
         self._menu_bg = Background()
 
     def on_menu_enter(self):
         self._menu_bg = Background()
diff --git a/prj.org b/prj.org
index b0fab5885a014f2324eff7e5c6076058d0b3d90f..4887b944ef6dffcd27360294c334219344ea9dd8 100644 (file)
--- a/prj.org
+++ b/prj.org
@@ -3,8 +3,7 @@
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
-* CODE asserts (also fps) only for dev or functional tests
-* READY create builds and update website/itch.io
+* CODE create builds and update website/itch.io
 * READY refactoring (recurring task)
 * BACKLOG intro animation (from target item to start position)
 * BACKLOG buttons of the scenes enabled sequentially
 * READY refactoring (recurring task)
 * BACKLOG intro animation (from target item to start position)
 * BACKLOG buttons of the scenes enabled sequentially