Commits

Lars Wassermann committed aad908f

removed skipped benchmark test in bootstrapped
changed test-sequence to make two tests green in test_miniimage
added reset of interrupt counter to perform to avoid interrupting during tests

Comments (0)

Files changed (3)

spyvm/interpreter.py

                 self.space, s_method, w_receiver, [], None)
         s_frame.push(w_receiver)
         s_frame.push_all(list(arguments_w))
+
+        self.interrupt_check_counter = constants.INTERRUPT_COUNTER_SIZE
         try:
             self.loop(s_frame.w_self())
         except ReturnFromTopLevel, e:

spyvm/test/test_bootstrappedimage.py

 def test_all_pointers_are_valid():
     tools.test_all_pointers_are_valid()
     tools.test_lookup_abs_in_integer()
-
-def test_tinyBenchmarks():
-    py.test.skip("Waste of time, because it doesn't assert anything.")
-    # we can't find PCSystem, because Smalltalkdict is nil...
-    import time
-    t0 = time.time()
-    sends = perform(w(5), 'benchFib')
-    t1 = time.time()
-    t = t1 - t0
-    print str(tools.space.unwrap_int(sends)/t) + " sends per second"

spyvm/test/test_miniimage.py

     perform(w(10).getclass(space), "compile:classified:notifying:", w(sourcecode), w('pypy'), w(None))
     assert perform(w(10), "fib").is_same_object(w(89))
 
-def test_primitive_perform_with_args():
-    from spyvm.test.test_primitives import prim
-    from spyvm import primitives
-    w_o = space.wrap_list([1, 2, 3])
-    w_methoddict = w_o.shadow_of_my_class(space)._s_superclass._s_superclass.w_methoddict()
-    w_methoddict.as_methoddict_get_shadow(space).sync_cache()
-    selectors_w = w_methoddict._shadow.methoddict.keys()
-    w_sel = None
-    for sel in selectors_w:
-        if sel.as_string() == 'size':
-            w_sel = sel
-    size = prim(primitives.PERFORM_WITH_ARGS, [w_o, w_sel, []])
-    assert size.value == 3
-
 def test_create_new_symbol():
     w_result = perform(w("someString"), "asSymbol")
     assert w_result is not None
     assert s_ctx.top().value == 2
     interp.step(s_ctx)
     assert s_ctx.top().value == 3
+
+def test_primitive_perform_with_args():
+    # this test should be last, because importing test_primitives has some (unknown) side-effects
+    from spyvm.test.test_primitives import prim
+    from spyvm import primitives
+    w_o = space.wrap_list([1, 2, 3])
+    w_methoddict = w_o.shadow_of_my_class(space)._s_superclass._s_superclass.w_methoddict()
+    w_methoddict.as_methoddict_get_shadow(space).sync_cache()
+    selectors_w = w_methoddict._shadow.methoddict.keys()
+    w_sel = None
+    for sel in selectors_w:
+        if sel.as_string() == 'size':
+            w_sel = sel
+    size = prim(primitives.PERFORM_WITH_ARGS, [w_o, w_sel, []])
+    assert size.value == 3