Skip to content

Commit

Permalink
Merge 61a36c1 into cbf674e
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Apr 8, 2016
2 parents cbf674e + 61a36c1 commit f0e4246
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 13 deletions.
16 changes: 14 additions & 2 deletions .build/download_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,24 @@ def download_and_extract(url, targetdir, callback=None):

DEPS = [("https://bitbucket.org/pypy/pypy/get/default.zip", cp.get("General", "pypy")),
("https://bitbucket.org/pypy/rsdl/get/sdl2.zip", cp.get("General", "rsdl"))]

def build_pypy32(exe, directory):
oldcwd = os.getcwd()
try:
os.chdir(directory)
import urllib
filename, headers = urllib.urlretrieve("https://bootstrap.pypa.io/get-pip.py")
os.system("%s %s" % (exe, filename))
os.system("%s -m pip install pytest-cov" % exe)
finally:
os.chdir(oldcwd)

if os.name == "nt":
DEPS.append(("http://libsdl.org/release/SDL2-devel-2.0.3-VC.zip", cp.get("Windows", "SDL")))
if os.getenv("APPVEYOR") is None:
# Don't download this on appveyor, saves time and memory
DEPS.extend([
("https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.1-win32.zip", "pypy-win32"),
("https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.1-win32.zip", ("pypy-win32", lambda d: build_pypy32("pypy.exe", d))),
("http://www.graphviz.org/pub/graphviz/stable/windows/graphviz-2.38.zip", cp.get("Windows", "Graphviz"))
])
elif "64bit" in platform.architecture()[0] and "linux" in sys.platform:
Expand Down Expand Up @@ -88,7 +100,7 @@ def build_sdl2(directory):
os.chdir(oldcwd)

DEPS.extend([
("https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.1-linux.tar.bz2", "pypy-linux32"),
("https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.1-linux.tar.bz2", ("pypy-linux32", lambda d: build_pypy32("bin/pypy", d))),
("https://github.com/CTPUG/pygame_cffi/archive/master.zip", "pygame_cffi"),
("https://www.libsdl.org/release/SDL2-2.0.3.tar.gz", ("SDL2-src", build_sdl2))
])
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ branches:
- windows-build
env:
global:
- TEST_TYPE=default
# use 32bit python on osx
- VERSIONER_PYTHON_PREFER_32_BIT=yes
- PATH=$PATH:$HOME/SDL2/bin
- LIBRARY_PATH=$LIBRARY_PATH:$HOME/SDL2/lib
- C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/SDL2/include
matrix:
- BUILD_ARCH=32bit BUILD_TYPE=test
- BUILD_ARCH=32bit BUILD_TYPE=test TEST_TYPE=default
- BUILD_ARCH=32bit BUILD_TYPE=test TEST_TYPE=coverage
- BUILD_ARCH=32bit BUILD_TYPE=build
- BUILD_ARCH=lldebug BUILD_TYPE=build
# Arm needs sudo, for sbuild and scratchbox2 packages.
Expand All @@ -81,3 +81,5 @@ before_script:
- if [ "$TRAVIS_OS_NAME" == osx -a "$BUILD_TYPE" == build ]; then export TESTSCRIPT=.travis/build-osx.sh; fi
script:
- $TESTSCRIPT
after_success:
- if [ "x$TEST_TYPE" == "xcoverage" ]; then export PATH=.build/pypy-linux32/bin/:$PATH ; coveralls; fi
9 changes: 7 additions & 2 deletions .travis/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ setup_osx() {
ls /Volumes/*SDL*/
sudo ditto /Volumes/*SDL*/SDL2.framework /Library/Frameworks/SDL2.framework
# todo: Squeak for jittests
curl -L -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install coveralls pytest-cov
}

setup_linux() {
Expand All @@ -17,9 +20,11 @@ setup_linux() {
tar xzvf Squeak-4.10*.tar.gz
rm Squeak-4.10*.tar.gz
ln -s $PWD/Squeak-4.10*/bin/squeak .build/squeak
# also install coveralls
export PATH=.build/pypy-linux32/bin/:$PATH
pip install coveralls
}

setup_$TRAVIS_OS_NAME

python .build/download_dependencies.py

setup_$TRAVIS_OS_NAME
1 change: 1 addition & 0 deletions .travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ case "$TEST_TYPE" in
default) testflag="" ;;
quick) testflag="-Q" ;;
slow) testflag="-S" ;;
coverage) testflag="-Q --cov=spyvm --cov-append" ;;
*) echo "Wrong TEST_TYPE value ($TEST_TYPE), not executing tests"
exit 0 ;;
esac
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ We also built for Armv7 (Raspberry Pi2, Beagleboard, ...) and Armv6 on the Raspb
* [ARMv6](https://www.hpi.uni-potsdam.de/hirschfeld/artefacts/rsqueak/rsqueak-linux-armv6raspbian-latest)
* [ARMv7](https://www.hpi.uni-potsdam.de/hirschfeld/artefacts/rsqueak/rsqueak-linux-armv7l-latest)

[![Coverage Status](https://coveralls.io/repos/github/HPI-SWA-Lab/RSqueak/badge.svg?branch=master)](https://coveralls.io/github/HPI-SWA-Lab/RSqueak?branch=master)

### Finding a working image

Although RSqueak can load images starting with Squeak 2, many
Expand Down
2 changes: 0 additions & 2 deletions spyvm/test/test_miniimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from spyvm import model, constants, storage_contexts, wrapper, primitives, interpreter, error
from .util import read_image, open_reader, copy_to_module, cleanup_module, TestInterpreter, slow_test, very_slow_test

pytestmark = slow_test

def setup_module():
space, interp, image, reader = read_image("mini.image")
w = space.w
Expand Down
5 changes: 3 additions & 2 deletions spyvm/test/test_miniimage_compiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from spyvm import model, constants, storage_contexts, wrapper, primitives, interpreter, error, storage_classes
from .util import read_image, open_reader, copy_to_module, cleanup_module, TestInterpreter, slow_test, very_slow_test

pytestmark = slow_test

def setup_module():
space, interp, _, _ = read_image("mini.image")
w = space.w
Expand All @@ -23,6 +21,7 @@ def teardown_module():
def test_load_image():
pass

@very_slow_test
def test_make_new_class():
sourcecode = """makeNewClass
^ Object
Expand All @@ -37,6 +36,7 @@ def test_make_new_class():
assert w_res.strategy.name == "MySubForm"
assert w_res.strategy._instance_size == 1

@very_slow_test
def test_change_class_layout():
sourcecode = """makeChangedClass
^ MessageSet subclass: #ChangedMessageSet
Expand All @@ -50,6 +50,7 @@ def test_change_class_layout():
assert w_res.strategy.name == "ChangedMessageSet"
assert w_res.strategy._instance_size == 15

@very_slow_test
def test_become_one_way():
sourcecode = """objectsForwardIdentityTo: to
<primitive: 72>"""
Expand Down
6 changes: 4 additions & 2 deletions spyvm/test/test_numerical_tower.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env python
import py, operator
import py, operator
from collections import OrderedDict
from spyvm.test.test_primitives import MockFrame
from .util import read_image, copy_to_module, cleanup_module, create_space
from .util import read_image, copy_to_module, cleanup_module, create_space, slow_test

pytestmark = slow_test


def setup_module():
Expand Down
4 changes: 3 additions & 1 deletion spyvm/test/test_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from rpython.rlib.rfloat import isinf, isnan
from rpython.rlib.rarithmetic import intmask, r_uint, r_longlong
from rpython.rtyper.lltypesystem import lltype, rffi
from .util import create_space, copy_to_module, cleanup_module, TestInterpreter
from .util import create_space, copy_to_module, cleanup_module, TestInterpreter, very_slow_test

def setup_module():
space = create_space(bootstrap = True)
Expand Down Expand Up @@ -661,12 +661,14 @@ def test_primitive_closure_value_value_with_temps():
assert s_new_context.gettemp(1).unwrap_string(None) == "second arg"
assert s_new_context.gettemp(2).unwrap_string(None) == "some value"

@very_slow_test
def test_primitive_some_instance():
import gc; gc.collect()
someInstance = map(space.wrap_list, [[1], [2]])
w_r = prim(primitives.SOME_INSTANCE, [space.w_Array])
assert w_r.getclass(space) is space.w_Array

@very_slow_test
def test_primitive_some_object():
import gc; gc.collect()
w_r = prim(primitives.SOME_OBJECT, [space.w_nil])
Expand Down

0 comments on commit f0e4246

Please sign in to comment.