Author: Lars Wassermann <lars.wasserm...@gmail.com> Branch: Changeset: r382:aad908fe6500 Date: 2013-05-07 11:27 +0200 http://bitbucket.org/pypy/lang-smalltalk/changeset/aad908fe6500/
Log: 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 diff --git a/spyvm/interpreter.py b/spyvm/interpreter.py --- a/spyvm/interpreter.py +++ b/spyvm/interpreter.py @@ -155,6 +155,8 @@ 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: diff --git a/spyvm/test/test_bootstrappedimage.py b/spyvm/test/test_bootstrappedimage.py --- a/spyvm/test/test_bootstrappedimage.py +++ b/spyvm/test/test_bootstrappedimage.py @@ -50,13 +50,3 @@ 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" diff --git a/spyvm/test/test_miniimage.py b/spyvm/test/test_miniimage.py --- a/spyvm/test/test_miniimage.py +++ b/spyvm/test/test_miniimage.py @@ -301,20 +301,6 @@ 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 @@ -405,3 +391,18 @@ 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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit