speed up things a bit by disabling sleeptimer
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 26 Mar 2007 18:25:29 +0000 (18:25 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 26 Mar 2007 18:25:29 +0000 (18:25 +0000)
tests/enigma.py
tests/events.py
tests/test_timer.py

index c1f3bf6..11c5b23 100644 (file)
@@ -25,8 +25,10 @@ class eTimer:
        def __init__(self):
                self.timeout = slot()
                self.next_activation = None
+               print "NEW TIMER"
        
        def start(self, msec, singleshot = False):
+               print "start timer", msec
                self.next_activation = time.time() + msec / 1000.0
                self.msec = msec
                self.singleshot = singleshot
@@ -49,6 +51,8 @@ def runIteration():
        assert len(running_timers), "no running timers, so nothing will ever happen!"
        running_timers.sort(key=lambda x: x.next_activation)
        
+       print "running:", running_timers
+       
        next_timer = running_timers[0]
 
        now = time.time()
@@ -127,6 +131,9 @@ class pNavigation:
        def playService(self, service):
                return None
 
+       def __repr__(self):
+               return "pNavigation"
+
 eRCInput = None
 getPrevAsciiCode = None
 
@@ -276,7 +283,9 @@ eServiceCenter()
 
 ##################### ENIGMA CHROOT
 
+print "import directories"
 import Tools.Directories
+print "done"
 
 chroot="."
 
@@ -288,7 +297,9 @@ Tools.Directories.defaultPaths[Tools.Directories.SCOPE_CONFIG] = ("/etc/enigma2/
 
 ##################### ENIGMA CONFIG
 
+print "import config"
 import Components.config
+print "done"
 
 my_config = [
 "config.skin.primary_skin=None\n"
@@ -306,14 +317,17 @@ class eActionMap:
 ##################### ENIGMA STARTUP:
 
 def init_nav():
+       print "init nav"
        import Navigation, NavigationInstance
        NavigationInstance.instance = Navigation.Navigation()
 
 def init_record_config():
+       print "init recording"
        import Components.RecordingConfig
        Components.RecordingConfig.InitRecordingConfig()
 
 def init_parental_control():
+       print "init parental"
        from Components.ParentalControl import InitParentalControl
        InitParentalControl()
 
index 83d7f2b..dde84e2 100644 (file)
@@ -45,7 +45,7 @@ def end_log(test_name):
                f.write(results)
                f.close()
        
-       print expected, results
+       print results
        
        if expected is not None:
                print "expected:"
index 17ac0fb..565a838 100644 (file)
@@ -7,17 +7,25 @@ import tests
 #enigma.reset()
 def test_timer(repeat = 0, timer_start = 3600, timer_length = 1000, sim_length = 86400 * 7):
 
-       print "loading RecordTimer"
-       import RecordTimer
-       print "ok"
+       import NavigationInstance
        
        at = time.time()
        
-       t = RecordTimer.RecordTimer()
+       t = NavigationInstance.instance.RecordTimer
+       print t
+       print "old mwt:", t.MaxWaitTime
        t.MaxWaitTime = 86400 * 1000
+       
+       # hack:
+       NavigationInstance.instance.SleepTimer.MaxWaitTime = 86400 * 1000
+
+       t.processed_timers = [ ]
+       t.timer_list = [ ]
+
 
        # generate a timer to test
        import xml.dom.minidom
+       import RecordTimer
 
        timer = RecordTimer.createTimer(xml.dom.minidom.parseString(
        """
@@ -84,4 +92,5 @@ os.environ['TZ'] = 'CET'
 time.tzset()
 
 #log(test_timer, test_name = "test_timer_repeating", base_time = calendar.timegm((2007, 3, 1, 12, 0, 0)), repeat=0x7f, sim_length = 86400 * 7)
-log(test_timer, test_name = "test_timer_repeating_dst_start", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), repeat=0x7f, sim_length = 86400 * 7)
+log(test_timer, test_name = "test_timer_repeating_dst_skip", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), timer_start = 3600, repeat=0x7f, sim_length = 86400 * 7)
+#log(test_timer, test_name = "test_timer_repeating_dst_start", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), timer_start = 10000, repeat=0x7f, sim_length = 86400 * 7)