Browse Source

Merge branch 'testing' into MvK_rules

Yentl Van Tendeloo 7 years ago
parent
commit
768513c697

+ 1 - 0
kernel/modelverse_kernel/main.py

@@ -1093,6 +1093,7 @@ class ModelverseKernel(object):
         else:
         else:
             # No input yet, so just wait and don't advance IP or phase
             # No input yet, so just wait and don't advance IP or phase
             self.input_value = None
             self.input_value = None
+            raise primitive_functions.SleepKernel(0.1, True)
 
 
     def output_init(self, task_root):
     def output_init(self, task_root):
         task_frame, =   yield [("RD", [task_root, "frame"])]
         task_frame, =   yield [("RD", [task_root, "frame"])]

+ 6 - 1
kernel/test/rules/test_rules_input.py

@@ -1,4 +1,5 @@
 import unittest
 import unittest
+from modelverse_kernel.primitives import SleepKernel
 from modelverse_kernel.main import ModelverseKernel
 from modelverse_kernel.main import ModelverseKernel
 from utils import execute_until_finished, MvSWrapper
 from utils import execute_until_finished, MvSWrapper
 
 
@@ -56,7 +57,11 @@ class TestInput(unittest.TestCase):
         self.mvs.execute("CD", [task_root, "input", input_queue_first])
         self.mvs.execute("CD", [task_root, "input", input_queue_first])
 
 
         # Do the invocation until it returns None
         # Do the invocation until it returns None
-        execute_until_finished(self.mvk, self.mvs)
+        try:
+            execute_until_finished(self.mvk, self.mvs)
+            self.fail()
+        except SleepKernel:
+            pass
 
 
         # Execution of the command finished, so the MvS should be in the correct new state right now
         # Execution of the command finished, so the MvS should be in the correct new state right now
         self.assertEquals(self.mvs.execute("RD", [root, "task_1"]), task_root)
         self.assertEquals(self.mvs.execute("RD", [root, "task_1"]), task_root)

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Tue Nov 28 16:07:56 2017
+Date:   Tue Nov 28 16:51:54 2017
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server